Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Updated to work with latest versions of Keras and Tensorflow #10

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 3 additions & 1 deletion pyfiction/agents/ssaqn_agent.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,9 @@
import re
from keras import Input
from keras.callbacks import TensorBoard
from keras.engine import Model

from keras.models import Model
# from keras.engine import Model

from keras.preprocessing.sequence import pad_sequences
from keras.preprocessing.text import Tokenizer
Expand Down
6 changes: 3 additions & 3 deletions pyfiction/examples/generalisation/generalisation.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@
import logging
import string

from keras.optimizers import RMSprop
from keras.utils import plot_model
import tensorflow as tf
from keras.utils.vis_utils import plot_model
from pyfiction.agents.ssaqn_agent import SSAQNAgent
from pyfiction.simulators.games.catsimulator2016_simulator import CatSimulator2016Simulator
from pyfiction.simulators.games.machineofdeath_simulator import MachineOfDeathSimulator
Expand Down Expand Up @@ -67,7 +67,7 @@
# Load or learn the vocabulary (random sampling on this many games could be extremely slow)
agent.initialize_tokens('vocabulary.txt')

optimizer = RMSprop(lr=0.00001)
optimizer = tf.keras.optimizers.RMSprop(learning_rate=0.00001)

embedding_dimensions = 16
lstm_dimensions = 32
Expand Down