claf.config.factory package¶
Submodules¶
-
class
claf.config.factory.base.
Factory
[source]¶ Bases:
object
Factory Base Class
Factory method pattern
In class-based programming, the factory method pattern is a creational pattern that uses factory methods to deal with the problem of creating objects without having to specify the exact class of the object that will be created. This is done by creating objects by calling a factory method—either specified in an interface and implemented by child classes, or implemented in a base class and optionally overridden by derived classes—rather than by calling a constructor.
-
class
claf.config.factory.data_loader.
DataLoaderFactory
(config)[source]¶ Bases:
claf.config.factory.base.Factory
DataLoader Factory Class
- Args:
config: data_loader config from argument (config.data_loader)
-
claf.config.factory.data_loader.
make_data_loader
(dataset, batch_size=32, shuffle=True, cuda_device_id=None)[source]¶
-
class
claf.config.factory.data_reader.
DataReaderFactory
(config)[source]¶ Bases:
claf.config.factory.base.Factory
DataReader Factory Class
Create Concrete reader according to config.dataset Get reader from reader registries (eg. @register(“reader:{reader_name}”))
- Args:
config: data_reader config from argument (config.data_reader)
-
class
claf.config.factory.model.
ModelFactory
(config)[source]¶ Bases:
claf.config.factory.base.Factory
Model Factory Class
Create Concrete model according to config.model_name Get model from model registries (eg. @register(“model:{model_name}”))
- Args:
config: model config from argument (config.model)
-
class
claf.config.factory.optimizer.
OptimizerFactory
(config)[source]¶ Bases:
claf.config.factory.base.Factory
Optimizer Factory Class
include optimizer, learning_rate_scheduler and exponential_moving_average
- Args:
config: optimizer config from argument (config.optimizer)
-
class
claf.config.factory.tokens.
TokenMakersFactory
(config)[source]¶ Bases:
claf.config.factory.base.Factory
TokenMakers Factory Class
- Args:
config: token config from argument (config.token)
-
LANGS
= ['eng', 'kor']¶
Module contents¶
-
class
claf.config.factory.
DataReaderFactory
(config)[source]¶ Bases:
claf.config.factory.base.Factory
DataReader Factory Class
Create Concrete reader according to config.dataset Get reader from reader registries (eg. @register(“reader:{reader_name}”))
- Args:
config: data_reader config from argument (config.data_reader)
-
class
claf.config.factory.
DataLoaderFactory
(config)[source]¶ Bases:
claf.config.factory.base.Factory
DataLoader Factory Class
- Args:
config: data_loader config from argument (config.data_loader)
-
class
claf.config.factory.
ModelFactory
(config)[source]¶ Bases:
claf.config.factory.base.Factory
Model Factory Class
Create Concrete model according to config.model_name Get model from model registries (eg. @register(“model:{model_name}”))
- Args:
config: model config from argument (config.model)
-
class
claf.config.factory.
OptimizerFactory
(config)[source]¶ Bases:
claf.config.factory.base.Factory
Optimizer Factory Class
include optimizer, learning_rate_scheduler and exponential_moving_average
- Args:
config: optimizer config from argument (config.optimizer)