claf.model package¶
Subpackages¶
Submodules¶
-
class
claf.model.base.
ModelBase
[source]¶ Bases:
torch.nn.modules.module.Module
Model Base Class
- Args:
token_embedder: (claf.tokens.token_embedder.base) TokenEmbedder
-
property
config
¶
-
property
dataset
¶
-
forward
(inputs)[source]¶ Defines the computation performed at every call.
Should be overridden by all subclasses.
Note
Although the recipe for forward pass needs to be defined within this function, one should call the
Module
instance afterwards instead of this since the former takes care of running the registered hooks while the latter silently ignores them.
-
property
log_dir
¶
-
property
metrics
¶
-
property
train_counter
¶
-
property
vocabs
¶
-
class
claf.model.base.
ModelWithTokenEmbedder
(token_embedder)[source]¶ Bases:
claf.model.base.ModelBase
-
class
claf.model.base.
ModelWithoutTokenEmbedder
(token_makers)[source]¶ Bases:
claf.model.base.ModelBase