neuralmonkey.model.model_part module

Basic functionality of all model parts.

class neuralmonkey.model.model_part.ModelPart(name: str, save_checkpoint: str = None, load_checkpoint: str = None, initializers: List[Tuple[str, Callable]] = None) → None

Bases: object

Base class of all model parts.

__init__(name: str, save_checkpoint: str = None, load_checkpoint: str = None, initializers: List[Tuple[str, Callable]] = None) → None

Initialize self. See help(type(self)) for accurate signature.

feed_dict(dataset: neuralmonkey.dataset.dataset.Dataset, train: bool) → Dict[tensorflow.python.framework.ops.Tensor, Any]
get_dependencies() → Set[ModelPart]

Collect recusively all encoders and decoders.

load(session: tensorflow.python.client.session.Session) → None

Load model part from a checkpoint file.

name

Get the name of the model part and its variable scope.

save(session: tensorflow.python.client.session.Session) → None

Save model part to a checkpoint file.

use_scope()

Return a context manager.

Return a context manager that (re)opens the model part’s variable and name scope.