spark.nn.brain#
Classes#
Brain metaclass. |
|
Configuration class for Brain's. |
|
Brain model. |
Module Contents#
- class spark.nn.brain.BrainMeta[source]#
Bases:
spark.core.module.SparkMetaBrain metaclass.
- class spark.nn.brain.BrainConfig(__skip_validation__=False, **kwargs)[source]#
Bases:
spark.core.config.BaseSparkConfigConfiguration class for Brain’s.
- Parameters:
__skip_validation__ (bool)
- input_map: dict[str, spark.core.specs.PortSpecs][source]#
- modules_map: dict[str, spark.core.specs.ModuleSpecs][source]#
- class spark.nn.brain.Brain(config=None, **kwargs)[source]#
Bases:
spark.core.module.SparkModuleBrain model.
A brain is a pipeline object used to represent and coordinate a collection of neurons and interfaces. This implementation relies on a cache system to simplify parallel computations; every timestep all the modules in the Brain read from the cache, update its internal state and update the cache state. Note that this introduces a small latency between elements of the brain, which for most cases is negligible, and for such a reason it is recommended that only full neuron models and interfaces are used within a Brain.
- Parameters:
config (BrainConfig)
- config: BrainConfig[source]#
- build(input_specs)[source]#
Build method.
- Parameters:
input_specs (dict[str, spark.core.specs.PortSpecs])
- __call__(**inputs)[source]#
Update brain’s states.
- Parameters:
inputs (spark.core.payloads.SparkPayload)
- Return type: