STAR
Cal STAR — firmware, DAQ server, and engine design
Loading...
Searching...
No Matches
autonomous_calibration_engine.ActiveLearningAgent Class Reference

Public Member Functions

 __init__ (self, int n_sensors, int n_params)
Optional[CalibrationRequest] should_request_calibration (self, int sensor_id, float prediction, float uncertainty, float voltage_or_adc, *, bool is_adc_code=False)
 record_calibration (self, int sensor_id)
 record_prediction_error (self, int sensor_id, float error)

Public Attributes

 n_sensors = n_sensors
 n_params = n_params
dict last_calibration_time = {}
dict error_history
int calibration_budget = 10
 last_budget_reset = time.time()
int requests_this_hour = 0

Detailed Description

Intelligent agent that decides when and where calibration is needed.
Uses uncertainty sampling and query-by-committee strategies.

Definition at line 292 of file autonomous_calibration_engine.py.

Constructor & Destructor Documentation

◆ __init__()

autonomous_calibration_engine.ActiveLearningAgent.__init__ ( self,
int n_sensors,
int n_params )

Definition at line 298 of file autonomous_calibration_engine.py.

Member Function Documentation

◆ record_calibration()

autonomous_calibration_engine.ActiveLearningAgent.record_calibration ( self,
int sensor_id )
Record that sensor was calibrated

Definition at line 398 of file autonomous_calibration_engine.py.

◆ record_prediction_error()

autonomous_calibration_engine.ActiveLearningAgent.record_prediction_error ( self,
int sensor_id,
float error )
Record prediction error for learning

Definition at line 402 of file autonomous_calibration_engine.py.

◆ should_request_calibration()

Optional[CalibrationRequest] autonomous_calibration_engine.ActiveLearningAgent.should_request_calibration ( self,
int sensor_id,
float prediction,
float uncertainty,
float voltage_or_adc,
* ,
bool is_adc_code = False )
Decide if calibration should be requested for this sensor.

Returns: CalibrationRequest if calibration needed, None otherwise

Definition at line 317 of file autonomous_calibration_engine.py.

Member Data Documentation

◆ calibration_budget

int autonomous_calibration_engine.ActiveLearningAgent.calibration_budget = 10

Definition at line 311 of file autonomous_calibration_engine.py.

◆ error_history

dict autonomous_calibration_engine.ActiveLearningAgent.error_history
Initial value:
= {
i: deque(maxlen=50) for i in range(n_sensors)
}

Definition at line 306 of file autonomous_calibration_engine.py.

◆ last_budget_reset

autonomous_calibration_engine.ActiveLearningAgent.last_budget_reset = time.time()

Definition at line 312 of file autonomous_calibration_engine.py.

◆ last_calibration_time

dict autonomous_calibration_engine.ActiveLearningAgent.last_calibration_time = {}

Definition at line 303 of file autonomous_calibration_engine.py.

◆ n_params

autonomous_calibration_engine.ActiveLearningAgent.n_params = n_params

Definition at line 300 of file autonomous_calibration_engine.py.

◆ n_sensors

autonomous_calibration_engine.ActiveLearningAgent.n_sensors = n_sensors

Definition at line 299 of file autonomous_calibration_engine.py.

◆ requests_this_hour

int autonomous_calibration_engine.ActiveLearningAgent.requests_this_hour = 0

Definition at line 313 of file autonomous_calibration_engine.py.


The documentation for this class was generated from the following file: