Untitled



In [1]:
import random
import numpy as np
from collections import deque

import keras
from keras.models import Sequential, Model
from keras.layers import Dense, Input, Embedding, Conv2D, Flatten, Activation, MaxPooling2D
from keras.optimizers import Adam
from keras.utils import to_categorical, plot_model

import logging
import pickle
import os.path


Using TensorFlow backend.

In [2]:
learning_rate = 0.001
name = "Cattle"

In [5]:
guylaine_input = Input(shape=(100,), name='ship_guylaine_input')
ship_input = Input(shape=(4,), name='ship_input')

state_input = keras.layers.concatenate([guylaine_input, ship_input])

action_input = Input(shape=(1,), name='action_input')

s_a_input = keras.layers.concatenate([state_input, action_input])

s_a_input = Dense(64, activation='relu')(s_a_input)
s_a_input = Dense(64, activation='relu')(s_a_input)
s_a_input = Dense(64, activation='relu')(s_a_input)
s_a_output = Dense(1, activation='linear', name='cattle_output')(s_a_input)

model = Model(inputs=[guylaine_input, ship_input, action_input], outputs=s_a_output)

model.compile(loss='mse',
              optimizer=Adam(lr=learning_rate))

In [ ]: