rnn

Main entry point

This is the main entry point. You can execute this file. See rnn.initConfig() for some arguments, or just run ./rnn.py --help. See Technological overview for a technical overview.

rnn.analyze_data(config)[source]
Parameters:config (Config) –
rnn.crnnGreeting(configFilename=None, commandLineOptions=None)[source]
rnn.executeMainTask()[source]
rnn.finalize()[source]
rnn.getCacheByteSizes()[source]
Return type:(int,int,int)

:returns cache size in bytes for (train,dev,eval)

rnn.init(configFilename=None, commandLineOptions=(), config_updates=None, extra_greeting=None)[source]
Parameters:
  • configFilename (str|None) –
  • commandLineOptions (tuple[str]|list[str]|None) –
  • config_updates (dict[str]|None) –
  • extra_greeting (str|None) –
rnn.initBackendEngine()[source]
rnn.initConfig(configFilename=None, commandLineOptions=(), extra_updates=None)[source]
Parameters:
  • configFilename (str|None) –
  • commandLineOptions (list[str]|tuple[str]) – e.g. sys.argv[1:]
  • extra_updates (dict[str]|None) –

Initializes the global config. There are multiple sources which are used to init the config:

  • configFilename, and maybe first item of commandLineOptions interpret as config filename
  • other options via commandLineOptions
  • extra_updates

Note about the order/priority of these:

  • extra_updates
  • options from commandLineOptions
  • configFilename
  • config filename from commandLineOptions[0]
  • extra_updates
  • options from commandLineOptions

extra_updates and commandLineOptions are used twice so that they are available when the config is loaded, which thus has access to them, and can e.g. use them via Python code. However, the purpose is that they overwrite any option from the config; that is why we apply them again in the end.

commandLineOptions is applied after extra_updates so that the user has still the possibility to overwrite anything set by extra_updates.

rnn.initConfigJsonNetwork()[source]
rnn.initData()[source]

Initializes the globals train,dev,eval of type Dataset.

rnn.initDevices()[source]
Return type:list[Device]
rnn.initEngine(devices)[source]

Initializes global engine.

rnn.initLog()[source]
rnn.load_data(config, cache_byte_size, files_config_key, **kwargs)[source]
Parameters:
  • config (Config) –
  • cache_byte_size (int) –
  • files_config_key (str) – such as “train” or “dev”
  • kwargs – passed on to init_dataset() or init_dataset_via_str()
Return type:

(Dataset,int)

:returns the dataset, and the cache byte size left over if we cache the whole dataset.

rnn.main(argv)[source]
rnn.needData()[source]
rnn.printTaskProperties(devices=None)[source]