tlc.core.builtins.schemas.schemas¶
A number of helper classes for common simple schemas
Module Contents¶
Classes¶
Class |
Description |
|---|---|
A schema for a red component (uint8 in range 0-255) |
|
A schema for a list of red components (uint8 in range 0-255) |
|
A schema for a green component (uint8 in range 0-255) |
|
A schema for a list of green components (uint8 in range 0-255) |
|
A schema for a blue component (uint8 in range 0-255) |
|
A schema for a list of blue components (uint8 in range 0-255) |
|
A schema for a float32 value |
|
A schema for a list of float32 values |
|
A schema for an int32 value |
|
A schema for a list of int32 values |
|
A schema for a boolean value |
|
A schema for a list of boolean values |
|
A schema for a string value |
|
A schema for a list of string values |
|
A schema for an image URL |
|
A Schema defining an (x, y, z) value |
|
A Schema defining COCO label |
|
A Schema defining CIFAR10 label |
|
A schema for a categorical label |
|
A schema for a list of categorical labels |
|
A schema for a 2D vector |
|
A schema for a 3D vector |
|
A schema for example ID values |
|
A schema for epoch values |
|
A schema for iteration values |
|
A schema describing a value that identifies a foreign table |
|
A schema for sample weight values |
API¶
- class RedComponentSchema(
- **kwargs: Any,
Bases:
tlc.core.schema.SchemaA schema for a red component (uint8 in range 0-255)
- class RedComponentListSchema(
- **kwargs: Any,
Bases:
tlc.core.builtins.schemas.schemas.RedComponentSchemaA schema for a list of red components (uint8 in range 0-255)
- class GreenComponentSchema(
- **kwargs: Any,
Bases:
tlc.core.schema.SchemaA schema for a green component (uint8 in range 0-255)
- class GreenComponentListSchema(
- **kwargs: Any,
Bases:
tlc.core.builtins.schemas.schemas.GreenComponentSchemaA schema for a list of green components (uint8 in range 0-255)
- class BlueComponentSchema(
- **kwargs: Any,
Bases:
tlc.core.schema.SchemaA schema for a blue component (uint8 in range 0-255)
- class BlueComponentListSchema(
- **kwargs: Any,
Bases:
tlc.core.builtins.schemas.schemas.BlueComponentSchemaA schema for a list of blue components (uint8 in range 0-255)
- class Float32Schema( )¶
Bases:
tlc.core.schema.SchemaA schema for a float32 value
- Parameters:
number_role – The role of the float32 value.
kwargs – Additional arguments to pass to the Schema constructor
- class Float32ListSchema( )¶
Bases:
tlc.core.builtins.schemas.schemas.Float32SchemaA schema for a list of float32 values
- Parameters:
list_size – The size of the list, if fixed-size. If None, the list can be of any size.
number_role – The role of the number values in the list.
kwargs – Additional arguments to pass to the Schema constructor
- class Int32Schema( )¶
Bases:
tlc.core.schema.SchemaA schema for an int32 value
- Parameters:
number_role – The role of the int32 value.
kwargs – Additional arguments to pass to the Schema constructor
- class Int32ListSchema( )¶
Bases:
tlc.core.builtins.schemas.schemas.Int32SchemaA schema for a list of int32 values
- Parameters:
list_size – The size of the list, if fixed-size. If None, the list can be of any size.
kwargs – Additional arguments to pass to the Schema constructor
- class BoolSchema(
- **kwargs: Any,
Bases:
tlc.core.schema.SchemaA schema for a boolean value
- Parameters:
kwargs – Additional arguments to pass to the Schema constructor
- class BoolListSchema( )¶
Bases:
tlc.core.builtins.schemas.schemas.BoolSchemaA schema for a list of boolean values
- Parameters:
list_size – The size of the list, if fixed-size. If None, the list can be of any size.
kwargs – Additional arguments to pass to the Schema constructor
- class StringSchema( )¶
Bases:
tlc.core.schema.SchemaA schema for a string value
- Parameters:
string_role – The role of the string value.
kwargs – Additional arguments to pass to the Schema constructor
- class StringListSchema( )¶
Bases:
tlc.core.builtins.schemas.schemas.StringSchemaA schema for a list of string values
- Parameters:
list_size – The size of the list, if fixed-size. If None, the list can be of any size.
kwargs – Additional arguments to pass to the Schema constructor
- class ImageUrlSchema(
- **kwargs: Any,
Bases:
tlc.core.schema.SchemaA schema for an image URL
- class XyzSchema(
- display_name: str = '',
- description: str = '',
- writable: bool = True,
- display_importance: float = 0,
- value_type: str = _DEFAULT_SCALAR_VALUE_TYPE,
Bases:
tlc.core.schema.SchemaA Schema defining an (x, y, z) value
- class COCOLabelSchema(
- display_name: str = 'label',
- description: str = 'COCO Label',
- writable: bool = False,
- display_importance: float = 0,
Bases:
tlc.core.schema.SchemaA Schema defining COCO label
- class CIFAR10LabelSchema(
- display_name: str = 'label',
- description: str = 'CIFAR-10 Label',
- writable: bool = False,
- display_importance: float = 0,
- value_type: str = _DEFAULT_SCALAR_VALUE_TYPE,
Bases:
tlc.core.schema.SchemaA Schema defining CIFAR10 label
- class CategoricalLabelSchema(
- class_names: list[str] | None = None,
- classes: Sequence[str] | Sequence[dict[str, str]] | Sequence[MapElement] | dict[float, str] | dict[int, str] | dict[float, MapElement] | dict[int, MapElement] | None = None,
- **kwargs: Any,
Bases:
tlc.core.schema.SchemaA schema for a categorical label
- Parameters:
class_names – Deprecated, use classes instead
classes – The classes to use for the label. If a list or sequence, each item will be converted to a MapElement and assigned a zero-based integer key. If a dict, the keys will be used as the label values and the values will be converted to MapElements.
kwargs – Additional arguments to pass to the Schema constructor
- class CategoricalLabelListSchema(
- classes: Sequence[str] | Sequence[dict[str, str]] | Sequence[MapElement] | dict[float, str] | dict[int, str] | dict[float, MapElement] | dict[int, MapElement] | None = None,
- class_names: list[str] | None = None,
- list_size: int | None = None,
- **kwargs: Any,
Bases:
tlc.core.builtins.schemas.schemas.CategoricalLabelSchemaA schema for a list of categorical labels
- Parameters:
classes – The classes to use for the label
class_names – Deprecated, use classes instead
list_size – The size of the list, if fixed-size. If None, the list can be of any size.
kwargs – Additional arguments to pass to the Schema constructor
- class FloatVector2Schema(
- display_name: str = '2D Embedding',
- description: str = '',
- writable: bool = False,
- display_importance: float = 0,
- number_role: str = NUMBER_ROLE_XY_COMPONENT,
- mode: Literal[numpy, python] = 'python',
Bases:
tlc.core.schema.SchemaA schema for a 2D vector
- class FloatVector3Schema(
- display_name: str = '3D Embedding',
- description: str = '',
- writable: bool = False,
- display_importance: float = 0,
- number_role: str = NUMBER_ROLE_XYZ_COMPONENT,
- mode: Literal[numpy, python] = 'python',
Bases:
tlc.core.schema.SchemaA schema for a 3D vector
- class ExampleIdSchema(
- display_name: str = 'Example ID',
- description: str = '',
- writable: bool = False,
- computable: bool = False,
Bases:
tlc.core.schema.SchemaA schema for example ID values
Example ID is a unique identifier for an example. It is used to identify examples across different tables.
- class EpochSchema(
- display_name: str = 'Epoch',
- description: str = 'Epoch of training',
- display_importance: float | None = None,
Bases:
tlc.core.schema.SchemaA schema for epoch values
- class IterationSchema(
- display_name: str = 'Iteration',
- description: str = 'The current iteration of the training process.',
- display_importance: float | None = None,
Bases:
tlc.core.schema.SchemaA schema for iteration values
- class ForeignTableIdSchema( )¶
Bases:
tlc.core.schema.SchemaA schema describing a value that identifies a foreign table
- class SampleWeightSchema(
- display_name: str = 'Weight',
- description: str = 'The weights of the samples in this table.',
- sample_type: str = 'hidden',
- default_value: float = 1.0,
Bases:
tlc.core.schema.SchemaA schema for sample weight values
Initialize the SampleWeightSchema
- Parameters:
display_name – The display name of the schema
description – The description of the schema
sample_type – The sample type of the schema
default_value – The default value of the schema