ADD PNN test
@@ -80,6 +80,24 @@ class StrategyTest(unittest.TestCase):
print("TRAIN STREAM ACC: ", main_metric.result())
assert main_metric.result() > 0.7
+ def test_pnn(self):
+ # check that pnn reaches high enough accuracy.
+ # Ensure nothing weird is happening with the multiple heads.
+ main_metric = StreamAccuracy()
+ exp_acc = ExperienceAccuracy()
+ evalp = EvaluationPlugin(main_metric, exp_acc, loggers=None)
+ strategy = PNNStrategy(
+ 1, 6, 50, 0.1, train_mb_size=32, device=get_device(),
+ eval_mb_size=512, train_epochs=1, evaluator=evalp)
+ scenario = get_fast_scenario(use_task_labels=True)
+
+ for train_batch_info in scenario.train_stream:
+ strategy.train(train_batch_info)
+
+ strategy.eval(scenario.train_stream[:])
+ print("TRAIN STREAM ACC: ", main_metric.result())
+ assert main_metric.result() > 0.7
+
if __name__ == '__main__':
unittest.main()
