🏭 Preprocessing Layers Factory
You can find all availble layers in the PreprocessorLayerFactory
class:
cast_to_float32_layer(name='cast_to_float32', **kwargs)
staticmethod
Create a CastToFloat32Layer layer.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
name |
str
|
The name of the layer. |
'cast_to_float32'
|
**kwargs |
dict
|
Additional keyword arguments to pass to the layer constructor. |
{}
|
Returns:
Type | Description |
---|---|
Layer
|
An instance of the CastToFloat32Layer layer. |
category_encoding_layer(name, **kwargs)
staticmethod
Create a CategoryEncoding layer.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
name |
str
|
The name of the layer. |
required |
**kwargs |
dict
|
Additional keyword arguments to pass to the layer constructor. |
{}
|
Returns:
Type | Description |
---|---|
Layer
|
An instance of the CategoryEncoding layer. |
concat_layer(name='concat', **kwargs)
staticmethod
Create a Concatenate layer.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
name |
str
|
The name of the layer. |
'concat'
|
**kwargs |
dict
|
Additional keyword arguments to pass to the layer constructor. |
{}
|
Returns:
Type | Description |
---|---|
Layer
|
An instance of the Concatenate layer. |
create_layer(layer_class, name=None, **kwargs)
staticmethod
Create a layer, automatically filtering kwargs based on the provided layer_class.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
layer_class |
The class of the layer to be created. |
required | |
name |
str
|
The name of the layer. Optional. |
None
|
**kwargs |
dict
|
Additional keyword arguments to pass to the layer constructor. |
{}
|
Returns:
Type | Description |
---|---|
Layer
|
An instance of the specified layer_class. |
crossing_layer(name, **kwargs)
staticmethod
Create a HashedCrossing layer.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
name |
str
|
The name of the layer. |
required |
**kwargs |
dict
|
Additional keyword arguments to pass to the layer constructor. |
{}
|
Returns:
Type | Description |
---|---|
Layer
|
An instance of the HashedCrossing layer. |
discretization_layer(name, **kwargs)
staticmethod
Create a Discretization layer.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
name |
str
|
The name of the layer. |
required |
**kwargs |
dict
|
Additional keyword arguments to pass to the layer constructor. |
{}
|
Returns:
Type | Description |
---|---|
Layer
|
An instance of the Discretization layer. |
embedding_layer(name, **kwargs)
staticmethod
Create a Embedding layer.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
name |
str
|
The name of the layer. |
required |
**kwargs |
dict
|
Additional keyword arguments to pass to the layer constructor. |
{}
|
Returns:
Type | Description |
---|---|
Layer
|
An instance of the Embedding layer. |
flatten_layer(name='flatten', **kwargs)
staticmethod
Create a Flatten layer.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
name |
str
|
The name of the layer. |
'flatten'
|
**kwargs |
dict
|
Additional keyword arguments to pass to the layer constructor. |
{}
|
Returns:
Type | Description |
---|---|
Layer
|
An instance of the Flatten layer. |
integer_lookup_layer(name, **kwargs)
staticmethod
Create a IntegerLookup layer.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
name |
str
|
The name of the layer. |
required |
**kwargs |
dict
|
Additional keyword arguments to pass to the layer constructor. |
{}
|
Returns:
Type | Description |
---|---|
Layer
|
An instance of the IntegerLookup layer. |
normalization_layer(name, **kwargs)
staticmethod
Create a Normalization layer.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
name |
str
|
The name of the layer. |
required |
**kwargs |
dict
|
Additional keyword arguments to pass to the layer constructor. |
{}
|
Returns:
Type | Description |
---|---|
Layer
|
An instance of the Normalization layer. |
rescaling_layer(name, **kwargs)
staticmethod
Create a Rescaling layer.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
name |
str
|
The name of the layer. |
required |
**kwargs |
dict
|
Additional keyword arguments to pass to the layer constructor. |
{}
|
Returns:
Type | Description |
---|---|
Layer
|
An instance of the Rescaling layer. |
string_lookup_layer(name, **kwargs)
staticmethod
Create a StringLookup layer.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
name |
str
|
The name of the layer. |
required |
**kwargs |
dict
|
Additional keyword arguments to pass to the layer constructor. |
{}
|
Returns:
Type | Description |
---|---|
Layer
|
An instance of the StringLookup layer. |
text_preprocessing_layer(name='text_preprocessing', **kwargs)
staticmethod
Create a TextPreprocessingLayer layer.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
name |
str
|
The name of the layer. |
'text_preprocessing'
|
**kwargs |
dict
|
Additional keyword arguments to pass to the layer constructor. |
{}
|
Returns:
Type | Description |
---|---|
Layer
|
An instance of the TextPreprocessingLayer layer. |
text_vectorization_layer(name='text_vectorization', **kwargs)
staticmethod
Create a TextVectorization layer.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
name |
str
|
The name of the layer. |
'text_vectorization'
|
**kwargs |
dict
|
Additional keyword arguments to pass to the layer constructor. |
{}
|
Returns:
Type | Description |
---|---|
Layer
|
An instance of the TextVectorization layer. |