simrunmodular_reduced_model_inferencereduced_modelRm

Rm

class simrun.modular_reduced_model_inference.reduced_model.Rm(name, db, tmin=None, tmax=None, width=None, selected_indices=None)

Reduced model class.

This is the top-level class for running reduced model inference. It provides an interface to add data extractors and strategies, and to run the optimization.

Parameters:
  • name (str) – Name of the reduced model

  • db (str) – Path to the database

  • tmin (float) – Minimum time for the simulation

  • tmax (float) – Maximum time for the simulation

  • width (float) – Width of the temporal kernel. This will be used as the \(\tau\) domain in e.g. RaisedCosineBasis

  • selected_indices (list) – List/nested list of integer indices for selected simulation trials

Attributes:

name

Name of the reduced model

Type:

str

db

Path to the database

Type:

str

tmin

Minimum time for the simulation

Type:

float

tmax

Maximum time for the simulation

Type:

float

width

Width of the temporal kernel. This will be used as the domain e.g. the \(\\tau\) domain in RaisedCosineBasis

Type:

float

n_trials

Amount of trials

Type:

int

data_extractors

Dictionary of _DataExtractor objects

Type:

dict

strategies

Dictionary of Strategy objects

Type:

dict

Data

Data view object

Type:

DataView

DataSplitEvaluation

Data split evaluation object

Type:

DataSplitEvaluation

selected_indices

List/nested list of integer indices for selected simulation trials

Type:

list

results_remote

Flag that keeps track whether results are stored locally or on a remote scheduler.

Type:

bool

Methods:

add_data_extractor(name, data_extractor, setup)

Add a data extractor to the reduced model.

add_strategy(strategy, setup, view)

Add a strategy to the reduced model.

get_n_trials()

Get the amount of trials.

extract(name)

Extract data using the data extractor.

run(client, n_workers, strategy_selection)

Run one or more strategies on the data.

_gather_results(client)

Fetch the solver results from the dask scheduler.

get_results(client)

Get the results of the optimization.