Esempio n. 1
0
 def __init__(self):
     environment_name = "MountainCar-v0"
     environment      = self.makeEnvironment(environment_name=environment_name)
     print(type(environment))
     self.model = Model( seed=42,
                         environment=environment,
                         environment_name=environment_name,
                         max_frames=300,
                         nr_of_workers=1,
                         pop_size=300,
                         hidden_shape=((6,),),
                         c1=1.0,
                         c2=1.0,
                         c3=0.4,
                         dt=3.0,
                         prob_add_link=0.1,
                         prob_add_node=0.03,
                         prob_mut_weights=0.8,
                         prob_mut_uniform=0.9,
                         prob_interspecies_mating=0.001,
                         elitism=0.2,
                         cppn_output_range=1.0,
                         cppn_weight_range=3.0,
                         function_set=[ '0.3989422804*np.exp(np.array(-0.5*({})).clip(min=-100,max=100))', #gaussian
                                        '1/(1+np.exp(np.array({}).clip(min=-100,max=100)))',            #sigmoid
                                        'np.sin({})',                     #sine
                                        'np.absolute({})'                      #absolute value
                                        ],
                         activation_function=(lambda x: x.clip(min=0))      #RELU
                         )
Esempio n. 2
0
def update_post():
    '''This is the route to update the number shown on the view'''

    print('updating the model with the new number from a POST request')
    model = Model(request.form['number'])

    print('updating the view with the new model')
    return render_template('view.html', data=model)
Esempio n. 3
0
def index():
    '''This is the default landing page'''

    print('instantiating a default model')
    model = Model()

    print('updating default view with default model')
    return render_template('view.html', data=model)