incerto.active.active_learning_loop

incerto.active.active_learning_loop#

incerto.active.active_learning_loop(model, x_pool, y_pool, strategy, num_rounds=10, initial_labeled=100, train_fn=None, eval_fn=None, random_seed=None)[source]#

Run a full active learning loop.

Parameters:
  • model (Module) – Model to train

  • x_pool (Tensor) – Full data pool

  • y_pool (Tensor) – Full labels

  • strategy – Query strategy (batch size is controlled by the strategy)

  • num_rounds (int) – Number of active learning rounds

  • initial_labeled (int) – Number of initial labeled samples

  • train_fn (Optional[callable]) – Function to train model (model, x_train, y_train)

  • eval_fn (Optional[callable]) – Function to evaluate model (model, x_test, y_test)

  • random_seed (Optional[int]) – Random seed

Return type:

dict

Returns:

Dictionary with results