From 51704eac23a9db99e6cc8961a9d5588b0b698ae9 Mon Sep 17 00:00:00 2001 From: rcalland Date: Thu, 15 Jun 2017 11:35:24 +0900 Subject: [PATCH] fix bug where np.array == None is ambiguous. Also added a note in the readme that theanets version 0.5.3 is required. It seems the newer versions have undergone an API change. --- README.md | 2 +- mpi/mpi_master.py | 3 +-- mpi/mpi_trainer.py | 2 +- 3 files changed, 3 insertions(+), 4 deletions(-) diff --git a/README.md b/README.md index 444b780..8ceb9d5 100644 --- a/README.md +++ b/README.md @@ -20,7 +20,7 @@ This code requires: * [Numpy](http://www.numpy.org/) * [Scipy](http://www.scipy.org/) * [Theano](http://deeplearning.net/software/theano/) -* [Theanets](http://theanets.readthedocs.org/en/stable/) +* [Theanets 0.5.3](http://theanets.readthedocs.org/en/stable/) * [Statsmodels](http://statsmodels.sourceforge.net/devel/) * [Matplotlib](http://matplotlib.org/) * [pyGPs](http://www-ai.cs.uni-dortmund.de/weblab/static/api_docs/pyGPs/) diff --git a/mpi/mpi_master.py b/mpi/mpi_master.py index 92c87b7..67f822d 100644 --- a/mpi/mpi_master.py +++ b/mpi/mpi_master.py @@ -16,7 +16,6 @@ def contains_row(x, X): for i in range(X.shape[0]): if all(X[i,:] == x): return True - return False def master_process(print_statements): @@ -61,7 +60,7 @@ def master_process(print_statements): if tag == WORKER_DONE: # data is a (1, m) array - if dataset == None: + if dataset is None: dataset = data else: diff --git a/mpi/mpi_trainer.py b/mpi/mpi_trainer.py index a405a7d..e16d322 100644 --- a/mpi/mpi_trainer.py +++ b/mpi/mpi_trainer.py @@ -21,7 +21,7 @@ def trainer_process(print_statements): if print_statements: print "TRAINER: Received from master, starting new neural net" - if dataset == None: + if dataset is None: dataset = new_data else: