Defining the agent

For Deep SARSA learning, we will be using the same agent we have used in the Deep Q Learning segment.

def agent(states, actions):
"""Simple Deep Neural Network."""
model = Sequential()
model.add(Flatten(input_shape=(1,states)))
model.add(Dense(16))
model.add(Activation('relu'))
model.add(Dense(16))
model.add(Activation('relu'))
model.add(Dense(16))
model.add(Activation('relu'))
model.add(Dense(actions))
model.add(Activation('linear'))
return model

model = agent(states, actions)
..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset
3.142.166.31