Repository: tonegas/nnodely (language: python)

Issue:
broke a test



Discussion / hints:

Fix patch:
diff --git a/.github/workflows/coveralls.yml b/.github/workflows/coveralls.yml
new file mode 100644
index 0000000..6d089b0
--- /dev/null
+++ b/.github/workflows/coveralls.yml
@@ -0,0 +1,33 @@
+name: Test Coveralls
+
+on:
+  push:
+    branches: [ "main"]
+  pull_request:
+    branches: [ "main" ]
+
+jobs:
+
+  build:
+    name: Build
+    runs-on: ubuntu-latest
+    steps:
+
+    - uses: actions/checkout@v4
+
+    - name: Set up Python 3.12
+      uses: actions/setup-python@v3
+      with:
+        python-version: 3.12
+    - name: Install dependencies
+      run: |
+        python -m pip install --upgrade pip
+        python -m pip install coverage coveralls
+        pip install -e .
+
+    - name: Tests with coverage
+      run: |
+        coverage run --omit='./results/*','./docs/*','./examples/*' -m unittest discover tests
+
+    - name: Coveralls
+      uses: coverallsapp/github-action@v2
diff --git a/.coveralls.yml b/TOREMOVE.coveralls.yml
similarity index 100%
rename from .coveralls.yml
rename to TOREMOVE.coveralls.yml
diff --git a/.travis.yml b/TOREMOVE.travis.yml
similarity index 100%
rename from .travis.yml
rename to TOREMOVE.travis.yml
diff --git a/nnodely/__init__.py b/nnodely/__init__.py
index 4229198..53da5df 100644
--- a/nnodely/__init__.py
+++ b/nnodely/__init__.py
@@ -22,7 +22,7 @@
 from nnodely.output import Output
 
 # Network elements
-from nnodely.activation import Relu, Tanh
+from nnodely.activation import Relu, Tanh, ELU
 from nnodely.fir import Fir
 from nnodely.linear import Linear
 from nnodely.arithmetic import Add, Sum, Sub, Mul, Pow, Neg


Test patch:
diff --git a/.github/workflows/python-package.yml b/.github/workflows/run-tests.yml
similarity index 98%
rename from .github/workflows/python-package.yml
rename to .github/workflows/run-tests.yml
index a540b9a..7d13dab 100644
--- a/.github/workflows/python-package.yml
+++ b/.github/workflows/run-tests.yml
@@ -1,7 +1,7 @@
 # This workflow will install Python dependencies, run tests and lint with a variety of Python versions
 # For more information see: https://docs.github.com/en/actions/automating-builds-and-tests/building-and-testing-python
 
-name: Python package
+name: Run tests
 
 on:
   push:
diff --git a/tests/test_losses.py b/tests/test_losses.py
index 17f9eab..d799744 100644
--- a/tests/test_losses.py
+++ b/tests/test_losses.py
@@ -21,6 +21,7 @@ class ModelyTrainingTest(unittest.TestCase):
     def TestAlmostEqual(self, data1, data2, precision=4):
         assert np.asarray(data1, dtype=np.float32).ndim == np.asarray(data2, dtype=np.float32).ndim, f'Inputs must have the same dimension! Received {type(data1)} and {type(data2)}'
         if type(data1) == type(data2) == list:
+            self.assertEqual(len(data1), len(data2))
             for pred, label in zip(data1, data2):
                 self.TestAlmostEqual(pred, label, precision=precision)
         else:
@@ -42,9 +43,9 @@ def test_losses_compare(self):
         dataset = {'in1': [1,1,1,1,1,1,1,1,1,1], 'out1': [2,2,2,2,2,2,2,2,2,2], 'out2': [5,5,5,5,5,5,5,5,5,5]}
         test.loadData(name='dataset', source=dataset)
         test.trainModel(optimizer='SGD', num_of_epochs=5, lr=0.5)
-        self.TestAlmostEqual( [[[2.0]], [[2.0]], [[2.0]], [[2.0]], [[2.0]], [[2.0]], [[2.0]], [[2.0]], [[2.0]], [[2.0]]], test.prediction['train_dataset_0.70']['error1']['A'])
-        self.TestAlmostEqual([[[6.0]],[[6.0]],[[6.0]],[[6.0]],[[6.0]],[[6.0]],[[6.0]],[[6.0]],[[6.0]],[[6.0]]] ,test.prediction['train_dataset_0.70']['error1']['B'])
-        self.TestAlmostEqual( [[[5.0]], [[5.0]], [[5.0]], [[5.0]], [[5.0]], [[5.0]], [[5.0]], [[5.0]], [[5.0]], [[5.0]]], test.prediction['train_dataset_0.70']['error2']['A'])
+        self.TestAlmostEqual( [[[2.0]], [[2.0]], [[2.0]], [[2.0]], [[2.0]], [[2.0]], [[2.0]]], test.prediction['train_dataset_0.70']['error1']['A'])
+        self.TestAlmostEqual([[[6.0]], [[6.0]], [[6.0]], [[6.0]], [[6.0]], [[6.0]], [[6.0]]] ,test.prediction['train_dataset_0.70']['error1']['B'])
+        self.TestAlmostEqual( [[[5.0]], [[5.0]], [[5.0]], [[5.0]], [[5.0]], [[5.0]], [[5.0]]], test.prediction['train_dataset_0.70']['error2']['A'])
         self.TestAlmostEqual([1.0, 16.0, 1.0, 16.0, 1.0], test.training['error1']['train'])
         self.TestAlmostEqual([16.0, 1.0, 16.0, 1.0, 16.0], test.training['error1']['val'])
         self.TestAlmostEqual([16.0, 1.0, 16.0, 1.0, 16.0], test.training['error2']['train'])
@@ -59,9 +60,9 @@ def test_losses_compare(self):
 
         test.neuralizeModel(clear_model=True)
         test.trainModel(optimizer='SGD', splits=[60,20,20], num_of_epochs=5, lr=0.5, train_batch_size=2)
-        self.TestAlmostEqual( [[[2.0]], [[2.0]], [[2.0]], [[2.0]], [[2.0]], [[2.0]], [[2.0]], [[2.0]], [[2.0]], [[2.0]]], test.prediction['train_dataset_0.60']['error1']['A'])
-        self.TestAlmostEqual([[[6.0]],[[6.0]],[[6.0]],[[6.0]],[[6.0]],[[6.0]],[[6.0]],[[6.0]],[[6.0]],[[6.0]]] ,test.prediction['train_dataset_0.60']['error1']['B'])
-        self.TestAlmostEqual( [[[5.0]], [[5.0]], [[5.0]], [[5.0]], [[5.0]], [[5.0]], [[5.0]], [[5.0]], [[5.0]], [[5.0]]], test.prediction['train_dataset_0.70']['error2']['A'])
+        self.TestAlmostEqual( [[[2.0]], [[2.0]], [[2.0]], [[2.0]], [[2.0]], [[2.0]]], test.prediction['train_dataset_0.60']['error1']['A'])
+        self.TestAlmostEqual([[[6.0]], [[6.0]], [[6.0]], [[6.0]], [[6.0]], [[6.0]]] ,test.prediction['train_dataset_0.60']['error1']['B'])
+        self.TestAlmostEqual( [[[5.0]], [[5.0]], [[5.0]], [[5.0]], [[5.0]], [[5.0]]], test.prediction['train_dataset_0.60']['error2']['A'])
         self.TestAlmostEqual([6.0, 11.0, 6.0, 11.0, 6.0], test.training['error1']['train'])
         self.TestAlmostEqual([16.0, 1.0, 16.0, 1.0, 16.0], test.training['error1']['val'])
         self.TestAlmostEqual([11.0, 6.0, 11.0, 6.0, 11.0], test.training['error2']['train'])
@@ -78,7 +79,7 @@ def test_losses_compare_closed_loop_state(self):
         a = Parameter('a', values=[[1]])
         output1 = Output('out', Fir(parameter=a)(input1.last()))
 
-        test = Modely(visualizer=TextVisualizer(5),seed=42)
+        test = Modely(visualizer=None,seed=42)
         test.addModel('model', output1)
         test.addClosedLoop(output1, input1)
         test.addMinimize('error1', target1.last(), output1)
@@ -88,9 +89,9 @@ def test_losses_compare_closed_loop_state(self):
         dataset = {'in1': [1,1,1,1,1,1,1,1,1,1], 'out1': [2,2,2,2,2,2,2,2,2,2], 'out2': [5,5,5,5,5,5,5,5,5,5]}
         test.loadData(name='dataset', source=dataset)
         test.trainModel(optimizer='SGD', num_of_epochs=5, lr=0.5)
-        self.TestAlmostEqual([[[[2.0]], [[2.0]], [[2.0]], [[2.0]], [[2.0]], [[2.0]], [[2.0]], [[2.0]], [[2.0]], [[2.0]]]], test.prediction['train_dataset_0.70']['error1']['A'])
-        self.TestAlmostEqual([[[[6.0]], [[6.0]], [[6.0]], [[6.0]], [[6.0]], [[6.0]], [[6.0]], [[6.0]], [[6.0]], [[6.0]]]] ,test.prediction['train_dataset_0.70']['error1']['B'])
-        self.TestAlmostEqual([[[[5.0]], [[5.0]], [[5.0]], [[5.0]], [[5.0]], [[5.0]], [[5.0]], [[5.0]], [[5.0]], [[5.0]]]], test.prediction['train_dataset_0.70']['error2']['A'])
+        self.TestAlmostEqual([[[[2.0]], [[2.0]], [[2.0]], [[2.0]], [[2.0]], [[2.0]], [[2.0]]]], test.prediction['train_dataset_0.70']['error1']['A'])
+        self.TestAlmostEqual([[[[6.0]], [[6.0]], [[6.0]], [[6.0]], [[6.0]], [[6.0]], [[6.0]]]] ,test.prediction['train_dataset_0.70']['error1']['B'])
+        self.TestAlmostEqual([[[[5.0]], [[5.0]], [[5.0]], [[5.0]], [[5.0]], [[5.0]], [[5.0]]]], test.prediction['train_dataset_0.70']['error2']['A'])
         self.TestAlmostEqual([1.0, 16.0, 1.0, 16.0, 1.0], test.training['error1']['train'])
         self.TestAlmostEqual([16.0, 1.0, 16.0, 1.0, 16.0], test.training['error1']['val'])
         self.TestAlmostEqual([16.0, 1.0, 16.0, 1.0, 16.0], test.training['error2']['train'])
@@ -105,9 +106,9 @@ def test_losses_compare_closed_loop_state(self):
 
         test.neuralizeModel(clear_model=True)
         test.trainModel(optimizer='SGD', splits=[60,20,20], num_of_epochs=5, lr=0.5, train_batch_size=2)
-        self.TestAlmostEqual([[[[2.0]], [[2.0]], [[2.0]], [[2.0]], [[2.0]], [[2.0]], [[2.0]], [[2.0]], [[2.0]], [[2.0]]]], test.prediction['train_dataset_0.60']['error1']['A'])
-        self.TestAlmostEqual([[[[6.0]], [[6.0]], [[6.0]], [[6.0]], [[6.0]], [[6.0]], [[6.0]], [[6.0]], [[6.0]], [[6.0]]]] ,test.prediction['train_dataset_0.60']['error1']['B'])
-        self.TestAlmostEqual([[[[5.0]], [[5.0]], [[5.0]], [[5.0]], [[5.0]], [[5.0]], [[5.0]], [[5.0]], [[5.0]], [[5.0]]]], test.prediction['train_dataset_0.70']['error2']['A'])
+        self.TestAlmostEqual([[[[2.0]], [[2.0]], [[2.0]], [[2.0]], [[2.0]], [[2.0]]]], test.prediction['train_dataset_0.60']['error1']['A'])
+        self.TestAlmostEqual([[[[6.0]], [[6.0]], [[6.0]], [[6.0]], [[6.0]], [[6.0]]]] ,test.prediction['train_dataset_0.60']['error1']['B'])
+        self.TestAlmostEqual([[[[5.0]], [[5.0]], [[5.0]], [[5.0]], [[5.0]], [[5.0]]]], test.prediction['train_dataset_0.60']['error2']['A'])
         self.TestAlmostEqual([6.0, 11.0, 6.0, 11.0, 6.0], test.training['error1']['train'])
         self.TestAlmostEqual([16.0, 1.0, 16.0, 1.0, 16.0], test.training['error1']['val'])
         self.TestAlmostEqual([11.0, 6.0, 11.0, 6.0, 11.0], test.training['error2']['train'])
@@ -141,7 +142,7 @@ def test_losses_compare_closed_loop(self):
         a = Parameter('a', values=[[1]])
         output1 = Output('out', Fir(parameter=a)(input1.last()))
 
-        test = Modely(visualizer=TextVisualizer(5),seed=42)
+        test = Modely(visualizer=None,seed=42)
         test.addModel('model', output1)
         test.addMinimize('error1', target1.last(), output1)
         test.addMinimize('error2', target2.last(), output1)
diff --git a/tests/test_model_predict.py b/tests/test_model_predict.py
index 633c7bc..e4f3a0e 100644
--- a/tests/test_model_predict.py
+++ b/tests/test_model_predict.py
@@ -36,7 +36,8 @@ class ModelyPredictTest(unittest.TestCase):
     
     def TestAlmostEqual(self, data1, data2, precision=4):
         assert np.asarray(data1, dtype=np.float32).ndim == np.asarray(data2, dtype=np.float32).ndim, f'Inputs must have the same dimension! Received {type(data1)} and {type(data2)}'
-        if type(data1) == type(data2) == list:  
+        if type(data1) == type(data2) == list:
+            self.assertEqual(len(data1),len(data2))
             for pred, label in zip(data1, data2):
                 self.TestAlmostEqual(pred, label, precision=precision)
         else:
@@ -60,7 +61,19 @@ def test_single_in(self):
         results = test({'in1': [[1], [2], [3], [4], [5], [6], [7], [8], [9], [10], [11], [12]], 'in2': [[5], [7], [9]]})
         self.assertEqual(3, len(results['out']))
         self.TestAlmostEqual([33.74938201904297, 40.309326171875, 46.86927032470703], results['out'])
-    
+
+    def test_activation(self):
+        torch.manual_seed(1)
+        in1 = Input('in1')
+        out_fun = ELU(in1.last()) + Relu(in1.last()) + Tanh(in1.last())
+        out = Output('out', out_fun)
+        test = Modely(visualizer=None, seed=1)
+        test.addModel('out',out)
+        test.neuralizeModel()
+        results = test({'in1': [-1, -0.5, 0, 0.2, 2, 10]})
+        self.assertEqual(6, len(results['out']))
+        self.TestAlmostEqual([-1.3937146663665771,-0.8555865287780762,0,0.5973753333091736,4.964027404785156,21.0], results['out'])
+
     def test_single_in_window(self):
         # Here there is more sample for each time step but the dimensions of the input is 1
         in1 = Input('in1')
@@ -360,7 +373,7 @@ def test_fir_and_parameter(self):
         test = Modely(visualizer=None)
         test.addModel('out',[out1, out2, out3, out4, out5])
         test.neuralizeModel(0.5)
-        # Time   -2, -1, 0, 1, 2, 3, 4
+        # Time   -3, -2, -1, 0, 1, 2, 3
         input = [-2, -1, 0, 1, 2, 3, 12]
         results = test({'x': input})
 
@@ -369,7 +382,7 @@ def test_fir_and_parameter(self):
         self.assertEqual((2,), np.array(results['out2']).shape)
         self.TestAlmostEqual([-2, -4], results['out2'])
         self.assertEqual((2, 1, 2), np.array(results['out3']).shape)
-        self.TestAlmostEqual([[[-2,1], [-4,2]]], results['out3'])
+        self.TestAlmostEqual([[[-2,1]], [[-4,2]]], results['out3'])
         self.assertEqual((2, 1, 2), np.array(results['out4']).shape)
         self.TestAlmostEqual([[[6.0, -2.0]], [[10.0, 0.0]]], results['out4'])
         self.assertEqual((2, 1, 2), np.array(results['out5']).shape)
@@ -535,8 +548,8 @@ def test_parametric_function_and_fir(self):
         test.neuralizeModel(0.1)
         with self.assertRaises(StopIteration): ## TODO: change to KeyError when checking the inputs
             test({'in1': [[1, 2, 2, 4]]})
-        results = test({'in1': [1, 2, 2, 4], 'in2': [1, 2, 2, 4]})
 
+        results = test({'in1': [1, 2, 2, 4], 'in2': [1, 2, 2, 4]})
         self.TestAlmostEqual(results['out'], [-0.4379930794239044])
         results = test({'in1': [[1, 2, 2, 4]], 'in2': [[1, 2, 2, 4]]}, sampled=True)
         self.TestAlmostEqual(results['out'], [-0.4379930794239044])
@@ -547,7 +560,6 @@ def test_parametric_function_and_fir(self):
         results = test({'in1': [[1, 2, 2, 4], [1, 2, 2, 4]], 'in2': [[1, 2, 2, 4], [5, 5, 5, 5]]}, sampled=True)
         self.TestAlmostEqual(results['out'], [-0.4379930794239044,  0.5163354873657227])
 
-        self.TestAlmostEqual(results['out'], [-0.4379930794239044])
         results = test({'in1': [[1, 2, 2, 4]], 'in2': [[1, 2, 2, 4]]}, sampled=True)
         self.TestAlmostEqual(results['out'], [-0.4379930794239044])
         results = test({'in1': [1, 2, 2, 4, 5], 'in2': [1, 2, 2, 4]})
@@ -621,6 +633,7 @@ def test_parametric_function_and_fir_with_parameters(self):
         test.neuralizeModel(0.1)
         with self.assertRaises(StopIteration):
             test({'in1': [[1, 2, 2, 4]]})
+
         results = test({'in1': [1, 2, 2, 4], 'in2': [1, 2, 2, 4]})
         self.TestAlmostEqual(results['out'], [0.3850506544113159])
         results = test({'in1': [[1, 2, 2, 4]], 'in2': [[1, 2, 2, 4]]}, sampled=True)
@@ -632,7 +645,6 @@ def test_parametric_function_and_fir_with_parameters(self):
         results = test({'in1': [[1, 2, 2, 4], [1, 2, 2, 4]], 'in2': [[1, 2, 2, 4], [5, 5, 5, 5]]}, sampled=True)
         self.TestAlmostEqual(results['out'], [0.3850506544113159, 1.446676254272461])
 
-        self.TestAlmostEqual(results['out'], [0.3850506544113159])
         results = test({'in1': [[1, 2, 2, 4]], 'in2': [[1, 2, 2, 4]]}, sampled=True)
         self.TestAlmostEqual(results['out'], [0.3850506544113159])
         results = test({'in1': [1, 2, 2, 4, 5], 'in2': [1, 2, 2, 4]})
diff --git a/tests/test_model_predict_recurrent.py b/tests/test_model_predict_recurrent.py
index 0b728bb..a9d3aaf 100644
--- a/tests/test_model_predict_recurrent.py
+++ b/tests/test_model_predict_recurrent.py
@@ -47,7 +47,8 @@ class ModelyRecurrentPredictTest(unittest.TestCase):
     
     def TestAlmostEqual(self, data1, data2, precision=4):
         assert np.asarray(data1, dtype=np.float32).ndim == np.asarray(data2, dtype=np.float32).ndim, f'Inputs must have the same dimension! Received {type(data1)} and {type(data2)}'
-        if type(data1) == type(data2) == list:  
+        if type(data1) == type(data2) == list:
+            self.assertEqual(len(data1), len(data2))
             for pred, label in zip(data1, data2):
                 self.TestAlmostEqual(pred, label, precision=precision)
         else:
diff --git a/tests/test_parameters_of_train.py b/tests/test_parameters_of_train.py
index 1b4a4e9..6e3e28c 100644
--- a/tests/test_parameters_of_train.py
+++ b/tests/test_parameters_of_train.py
@@ -29,6 +29,7 @@ class ModelyTrainingTestParameter(unittest.TestCase):
     def TestAlmostEqual(self, data1, data2, precision=4):
         assert np.asarray(data1, dtype=np.float32).ndim == np.asarray(data2, dtype=np.float32).ndim, f'Inputs must have the same dimension! Received {type(data1)} and {type(data2)}'
         if type(data1) == type(data2) == list:
+            self.assertEqual(len(data1), len(data2))
             for pred, label in zip(data1, data2):
                 self.TestAlmostEqual(pred, label, precision=precision)
         else:
diff --git a/tests/test_results.py b/tests/test_results.py
index 6b013be..b4f73fe 100644
--- a/tests/test_results.py
+++ b/tests/test_results.py
@@ -22,6 +22,7 @@ class ModelyTrainingTest(unittest.TestCase):
     def TestAlmostEqual(self, data1, data2, precision=4):
         assert np.asarray(data1, dtype=np.float32).ndim == np.asarray(data2, dtype=np.float32).ndim, f'Inputs must have the same dimension! Received {type(data1)} and {type(data2)}'
         if type(data1) == type(data2) == list:
+            self.assertEqual(len(data1), len(data2))
             for pred, label in zip(data1, data2):
                 self.TestAlmostEqual(pred, label, precision=precision)
         else:
diff --git a/tests/test_train.py b/tests/test_train.py
index 2a9e875..995e978 100644
--- a/tests/test_train.py
+++ b/tests/test_train.py
@@ -21,6 +21,7 @@ class ModelyTrainingTest(unittest.TestCase):
     def TestAlmostEqual(self, data1, data2, precision=4):
         assert np.asarray(data1, dtype=np.float32).ndim == np.asarray(data2, dtype=np.float32).ndim, f'Inputs must have the same dimension! Received {type(data1)} and {type(data2)}'
         if type(data1) == type(data2) == list:
+            self.assertEqual(len(data1), len(data2))
             for pred, label in zip(data1, data2):
                 self.TestAlmostEqual(pred, label, precision=precision)
         else:
diff --git a/tests/test_train_recurrent.py b/tests/test_train_recurrent.py
index bedcfef..354db6a 100644
--- a/tests/test_train_recurrent.py
+++ b/tests/test_train_recurrent.py
@@ -29,11 +29,13 @@ class ModelyTrainingTest(unittest.TestCase):
     def assertAlmostEqual(self, data1, data2, precision=3):
         if type(data1) == type(data2) == list:
             assert np.asarray(data1, dtype=np.float32).ndim == np.asarray(data2,dtype=np.float32).ndim, f'Inputs must have the same dimension! Received {type(data1)} and {type(data2)}'
+            self.assertEqual(len(data1), len(data2))
             for pred, label in zip(data1, data2):
                 self.assertAlmostEqual(pred, label, precision=precision)
         elif type(data1) == type(data2) == dict:
-                for (pred_key,pred_value), (label_key,label_value) in zip(data1.items(), data2.items()):
-                    self.assertAlmostEqual(pred_value, label_value, precision=precision)
+            self.assertEqual(len(data1.items()), len(data2.items()))
+            for (pred_key,pred_value), (label_key,label_value) in zip(data1.items(), data2.items()):
+                self.assertAlmostEqual(pred_value, label_value, precision=precision)
         else:
             super().assertAlmostEqual(data1, data2, places=precision)
 
@@ -844,15 +846,15 @@ def test_training_values_fir_connect_train_linear_more_window(self):
                              test.internals['inout_1_2']['XY'])
         self.assertAlmostEqual({'inout': [[[0.0], [0.0], [0.0], [W[0][0][0] * 4.0 + W[0][1][0] * 2.0 + b[0][0]],
                                          [W[0][0][0] * 6.0 + W[0][1][0] * 5.0 + b[0][0]]]]},
-                             test.internals['inout_1_0']['state'])
+                             test.internals['inout_1_0']['connect'])
         self.assertAlmostEqual({'inout': [[[0.0], [0.0], [W[0][0][0] * 4.0 + W[0][1][0] * 2.0 + b[0][0]],
                                          [W[0][0][0] * 6.0 + W[0][1][0] * 5.0 + b[0][0]],
                                          [W[0][0][0] * 4.0 + W[0][1][0] * 5.0 + b[0][0]]]]},
-                             test.internals['inout_1_1']['state'])
+                             test.internals['inout_1_1']['connect'])
         self.assertAlmostEqual({'inout': [
             [[0.0], [W[0][0][0] * 4.0 + W[0][1][0] * 2.0 + b[0][0]], [W[0][0][0] * 6.0 + W[0][1][0] * 5.0 + b[0][0]],
              [W[0][0][0] * 4.0 + W[0][1][0] * 5.0 + b[0][0]], [W[0][0][0] * 0.0 + W[0][1][0] * 0.0 + b[0][0]]]]},
-                             test.internals['inout_1_2']['state'])
+                             test.internals['inout_1_2']['connect'])
         with self.assertRaises(KeyError):
             test.internals['inout_2_0']
 
@@ -1396,7 +1398,7 @@ def test_train_compare_state_and_closed_loop(self):
         target1 = Input('target1')
         target2 = Input('target2', dimensions=2)
 
-        test = Modely(visualizer=TextVisualizer(), seed=42)
+        test = Modely(visualizer=None, seed=42)
         test.addModel('model', [output1,output2])
         test.addMinimize('error1', output1, target1.sw(2))
         test.addMinimize('error2', output2, target2.last())
@@ -1418,7 +1420,7 @@ def test_train_compare_state_and_closed_loop(self):
         target1 = Input('target1')
         target2 = Input('target2', dimensions=2)
 
-        test2 = Modely(visualizer=TextVisualizer(), seed=42)
+        test2 = Modely(visualizer=None, seed=42)
         test2.addModel('model', [output1, output2])
         test2.addMinimize('error1', output1, target1.sw(2))
         test2.addMinimize('error2', output2, target2.last())
diff --git a/tests/test_utils.py b/tests/test_utils.py
index 29c1029..600bc50 100644
--- a/tests/test_utils.py
+++ b/tests/test_utils.py
@@ -22,7 +22,6 @@ def test_linear_interp_with_batched_input_1(self):
         y_data = torch.tensor([[0.5],[0.6],[0.7],[0.8],[0.9],[1.0],[1.1],[1.2],[1.3],[1.4]])
 
         y = linear_interp(x,x_data,y_data)
-        print('Output y of linear_interp with batches:\n', y)
         self.assertEqual(y.shape, x.shape)  # check that the output has the same shape as the input
 
 if __name__ == '__main__':