deepr.layers.LookupFromMapping

class deepr.layers.LookupFromMapping(table_name, mapping, default_value=None, key_dtype=None, value_dtype=None, reuse=False, **kwargs)[source]

Lookup From Mapping Layer.

default_value

Default value for missing keys

Type:

Any

key_dtype

Keys type

Type:

tf.DType

mapping

Mapping keys -> index

Type:

Dict[Any, Any]

reuse

If True, reuse the layer with the same name

Type:

bool

table_name

Name of the HashTable

Type:

str

value_dtype

Values type

Type:

tf.DType

__init__(table_name, mapping, default_value=None, key_dtype=None, value_dtype=None, reuse=False, **kwargs)[source]

Methods

__init__(table_name, mapping[, ...])

forward(tensors[, mode])

Forward method of the layer

forward_as_dict(tensors[, mode])

Forward method on a dictionary of Tensors.