You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
def AutoencoderLearner(inputs, encoding_size, epochs=200, verbose=False):
"""
Simple example of linear auto encoder learning producing the input itself.
:param inputs: a batch of input data in np.ndarray type
:param encoding_size: int, the size of encoding layer
:param epochs: number of epochs
:param verbose: verbosity mode
:return: a keras model
"""
# init data
input_size = len(inputs[0])
# init model
model = Sequential()
model.add(Dense(encoding_size, input_dim=input_size, activation='relu', kernel_initializer='random_uniform',
bias_initializer='ones'))
model.add(Dense(input_size, activation='relu', kernel_initializer='random_uniform', bias_initializer='ones'))
# update model with sgd
sgd = optimizers.SGD(lr=0.01)
E AttributeError: module 'keras.optimizers' has no attribute 'SGD'
Dear authors of aima-python
I have problem when i tried to install the aima-python on my computer. could you please see the error message below
============================= test session starts ==============================
platform linux -- Python 3.8.10, pytest-7.0.1, pluggy-1.0.0
rootdir: /home/pc/aima-python, configfile: pytest.ini
plugins: cov-3.0.0
collected 419 items
tests/test_agents.py ................ [ 3%]
tests/test_agents4e.py ................ [ 7%]
tests/test_csp.py ......................................... [ 17%]
tests/test_deep_learning4e.py ...F [ 18%]
tests/test_games.py ... [ 19%]
tests/test_games4e.py .... [ 20%]
tests/test_knowledge.py ........... [ 22%]
tests/test_learning.py ............... [ 26%]
tests/test_learning4e.py ............. [ 29%]
tests/test_logic.py ...................................... [ 38%]
tests/test_logic4e.py .................................... [ 47%]
tests/test_mdp.py ...... [ 48%]
tests/test_mdp4e.py ...... [ 49%]
tests/test_nlp.py .................... [ 54%]
tests/test_nlp4e.py ............ [ 57%]
tests/test_perception4e.py .......F. [ 59%]
tests/test_planning.py ..................................... [ 68%]
tests/test_probabilistic_learning.py . [ 68%]
tests/test_probability.py ........................ [ 74%]
tests/test_probability4e.py ...................... [ 79%]
tests/test_reinforcement_learning.py .... [ 80%]
tests/test_reinforcement_learning4e.py .... [ 81%]
tests/test_search.py .......................... [ 87%]
tests/test_text.py ............... [ 91%]
tests/test_utils.py .................................... [100%]
=================================== FAILURES ===================================
_______________________________ test_autoencoder _______________________________
tests/test_deep_learning4e.py:74:
inputs = array([[5.1, 3.5, 1.4, 0.2, 0. ],
[4.9, 3. , 1.4, 0.2, 0. ],
[4.7, 3.2, 1.3, 0.2, 0. ],
[4.6, 3.1... 5. , 1.9, 2. ],
[6.5, 3. , 5.2, 2. , 2. ],
[6.2, 3.4, 5.4, 2.3, 2. ],
[5.9, 3. , 5.1, 1.8, 2. ]])
encoding_size = 100, epochs = 200, verbose = False
E AttributeError: module 'keras.optimizers' has no attribute 'SGD'
deep_learning4e.py:578: AttributeError
_____________________________ test_simple_convnet ______________________________
tests/test_perception4e.py:65:
train_size = 1000, val_size = 100, test_size = 10
E AttributeError: module 'keras.utils' has no attribute 'to_categorical'
perception4e.py:312: AttributeError
=========================== short test summary info ============================
FAILED tests/test_deep_learning4e.py::test_autoencoder - AttributeError: modu...
FAILED tests/test_perception4e.py::test_simple_convnet - AttributeError: modu...
=================== 2 failed, 417 passed in 73.95s (0:01:13) ===================
The text was updated successfully, but these errors were encountered: