File tree Expand file tree Collapse file tree 1 file changed +4
-5
lines changed Expand file tree Collapse file tree 1 file changed +4
-5
lines changed Original file line number Diff line number Diff line change 11"""
2- This example demonstrates how to use the active learning interface with Keras.
3- The example uses the scikit-learn wrappers of Keras. For more info, see https://keras.io/scikit-learn-api/
2+ This example demonstrates how to use the active learning interface with Pytorch.
3+ The example uses Skorch, a scikit learn wrapper of Pytorch.
4+ For more info, see https://skorch.readthedocs.io/en/stable/
45"""
56
67import torch
7- import keras
88import numpy as np
99from keras .datasets import mnist
1010from torch import nn
1111from skorch import NeuralNetClassifier
1212from modAL .models import ActiveLearner
13- from tqdm import tqdm
1413
1514# build class for the skorch API
1615class Torch_Model (nn .Module ):
@@ -84,7 +83,7 @@ def forward(self, x):
8483
8584# the active learning loop
8685n_queries = 10
87- for idx in tqdm ( range (n_queries ) ):
86+ for idx in range (n_queries ):
8887 query_idx , query_instance = learner .query (X_pool , n_instances = 100 )
8988 print (query_idx )
9089 learner .teach (X_pool [query_idx ], y_pool [query_idx ], only_new = True )
You can’t perform that action at this time.
0 commit comments