PyRates.pyrates.backend.base¶
pyrates.backend.base module¶
default PyRates backend. Contains all pyrates-internal function definitions and links to numpy functions.
pyrates.backend.base.base_backend module¶
Contains wrapper classes for different backends that are needed by the parser module.
A new backend needs to implement the following methods: - __init__ - run - add_var - add_op - add_layer
Currently supported backends: - Numpy: BaseBackend. - Tensorflow: TensorflowBackend. - Fortran: FortranBackend (experimental).
-
class
pyrates.backend.base.base_backend.
BaseBackend
(ops: Optional[Dict[str, str]] = None, imports: Optional[List[str]] = None, **kwargs)[source]¶ Bases:
pyrates.backend.base.base_backend.CodeGen
Default backend class. Transforms all network equations into their numpy equivalents. Based on a Python code generator.
-
add_var_hist
(lhs: str, delay: Union[pyrates.backend.computegraph.ComputeVar, float], state_idx: str, **kwargs)[source]¶
-
add_var_update
(lhs: pyrates.backend.computegraph.ComputeVar, rhs: str, lhs_idx: Optional[str] = None, rhs_shape: Optional[tuple] = ())[source]¶
-
create_index_str
(idx: Union[str, int, tuple], separator: str = ',', apply: bool = True, **kwargs) → Tuple[str, dict][source]¶
-
generate_func_head
(func_name: str, state_var: str = 'y', return_var: str = 'dy', func_args: list = None, add_hist_func: bool = False)[source]¶
-
pyrates.backend.base.base_funcs module¶
Contains function definitions that may be used for PyRates model equations.