From 359f8150ead1b33a1b1c126cbb03fb08475d0abc Mon Sep 17 00:00:00 2001 From: alexwang2013 Date: Sun, 17 Jan 2021 17:58:00 +0900 Subject: [PATCH 1/2] fixed issue #36 missing 1 required positional argument: 'units' ann.py rnn --- bulbea/learn/models/ann.py | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/bulbea/learn/models/ann.py b/bulbea/learn/models/ann.py index cc881c3a..c4c163e8 100644 --- a/bulbea/learn/models/ann.py +++ b/bulbea/learn/models/ann.py @@ -4,7 +4,7 @@ from keras.models import Sequential from keras.layers import recurrent from keras.layers import core - +from keras.layers import Embedding from bulbea.learn.models import Supervised class ANN(Supervised): @@ -24,16 +24,14 @@ def __init__(self, sizes, optimizer = 'rmsprop'): self.model = Sequential() self.model.add(cell( - input_dim = sizes[0], - output_dim = sizes[1], - return_sequences = True + units=sizes[1],return_sequences=True )) for i in range(2, len(sizes) - 1): self.model.add(cell(sizes[i], return_sequences = False)) self.model.add(core.Dropout(dropout)) - self.model.add(core.Dense(output_dim = sizes[-1])) + self.model.add(core.Dense(sizes[-1])) self.model.add(core.Activation(activation)) self.model.compile(loss = loss, optimizer = optimizer) From 6d844ffcf99eda2850eb2514167ee512b45cd1c3 Mon Sep 17 00:00:00 2001 From: alexwang2013 Date: Sun, 17 Jan 2021 17:58:00 +0900 Subject: [PATCH 2/2] fixed issue #36 missing 1 required positional argument: 'units' ann.py rnn --- bulbea/learn/models/ann.py | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/bulbea/learn/models/ann.py b/bulbea/learn/models/ann.py index cc881c3a..939f7ceb 100644 --- a/bulbea/learn/models/ann.py +++ b/bulbea/learn/models/ann.py @@ -4,7 +4,6 @@ from keras.models import Sequential from keras.layers import recurrent from keras.layers import core - from bulbea.learn.models import Supervised class ANN(Supervised): @@ -24,16 +23,14 @@ def __init__(self, sizes, optimizer = 'rmsprop'): self.model = Sequential() self.model.add(cell( - input_dim = sizes[0], - output_dim = sizes[1], - return_sequences = True + units=sizes[1],return_sequences=True )) for i in range(2, len(sizes) - 1): self.model.add(cell(sizes[i], return_sequences = False)) self.model.add(core.Dropout(dropout)) - self.model.add(core.Dense(output_dim = sizes[-1])) + self.model.add(core.Dense(sizes[-1])) self.model.add(core.Activation(activation)) self.model.compile(loss = loss, optimizer = optimizer)