Blocks allows module-wide configuration values to be set using a YAML configuration file and environment variables. Environment variables override the configuration file which in its turn overrides the defaults.
The configuration is read from
~/.blocksrc if it exists. A custom
configuration file can be used by setting the
variable. A configuration file is of the form:
If a setting is not configured and does not provide a default, a
ConfigurationError is raised when it is
Configuration values can be accessed as attributes of
>>> from blocks.config import config >>> print(config.default_seed) 1
The following configurations are supported:
The recursion max depth limit used in
MainLoopas well as in other situations when deep recursion is required. The most notable example of such a situation is pickling or unpickling a complex structure with lots of objects, such as a big Theano computation graph.
A boolean value which determines whether to print profiling information at the end of a call to
The backend to use for logging experiments. Defaults to python, which stores the log as a Python object in memory. The other option is sqlite.
The SQLite database file to use.
The maximum size of an object to store in an SQLite database in bytes. Objects beyond this size will trigger a warning. Defaults to 4 kilobyte.
The directory in which Blocks will create temporary files. If unspecified, the platform-dependent default chosen by the Python
tempfilemodule is used.
Error raised when a configuration value is requested but not set.