neuralmonkey.config package

Submodules

neuralmonkey.config.builder module

This module is responsible for instantiating objects specified by the experiment configuration

class neuralmonkey.config.builder.ClassSymbol(string)

Bases: object

Represents a class (or other callable) in configuration.

create()
neuralmonkey.config.builder.build_config(config_dicts, ignore_names)

Builds the model from the configuration

Parameters:
  • config_dicts – The parsed configuration file
  • ignore_names – A set of names that should be ignored during the loading.
neuralmonkey.config.builder.build_object(value, all_dicts, existing_objects, depth)

Builds an object from config dictionary of its arguments. It works recursively.

Parameters:
  • value – Value that should be resolved (either a literal value or a config section name)
  • all_dicts – Configuration dictionaries used to find configuration of unconstructed objects.
  • existing_objects – Dictionary of already constructed objects.
  • ignore_names – Set of names that shoud be ignored.
  • depth – The current depth of recursion. Used to prevent an infinite
  • recursion.
neuralmonkey.config.builder.instantiate_class(name, all_dicts, existing_objects, depth)

Instantiate a class from the configuration

Arguments: see help(build_object)

neuralmonkey.config.configuration module

class neuralmonkey.config.configuration.Configuration

Bases: object

Loads the configuration file in an analogical way the python’s argparse.ArgumentParser works.

add_argument(name: str, arg_type=<class 'object'>, required=False, default=None, cond=None) → None
build_model() → None
ignore_argument(name: str) → None
load_file(path: str) → None
make_namespace(d_obj) → argparse.Namespace

neuralmonkey.config.exceptions module

Module that contains exceptions handled in config parsing and loading

exception neuralmonkey.config.exceptions.ConfigBuildException(object_name, original_exception)

Bases: Exception

Exception caused by error in loading the model

exception neuralmonkey.config.exceptions.ConfigInvalidValueException(value, message)

Bases: Exception

exception neuralmonkey.config.exceptions.IniError(line, message, original_exc=None)

Bases: Exception

Exception caused by error in INI file syntax

neuralmonkey.config.parsing module

Module responsible for INI parsing

neuralmonkey.config.parsing.parse_file(config_file)

Parses an INI file and creates all values

neuralmonkey.config.utils module

Module contents