<filename>lunarlander/model.py
import gym
import numpy as np
from tensorflow.keras.models import Sequential
from tensorflow.keras.layers import Dense, Flatten

env = gym.make('LunarLander-v2')
print("Observation space: {}".format(env.observation_space))
print("Action space: {}".format(env.action_space))

states = env.observation_space.shape[0]
actions = env.action_space.n


def build_model(states, actions):
    model = Sequential()
    model.add(Flatten(input_shape=(1, states)))
    model.add(Dense(512, activation='relu'))
    model.add(Dense(256, activation='relu'))
    model.add(Dense(128, activation='relu'))
    model.add(Dense(actions, activation='linear'))
    return model
