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 (torch.nn.Module) – Model to train
x_pool (torch.Tensor) – Full data pool
y_pool (torch.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 (callable | None) – Function to train model (model, x_train, y_train)
eval_fn (callable | None) – Function to evaluate model (model, x_test, y_test)
random_seed (int | None) – Random seed
- Return type:
dict
- Returns:
Dictionary with results