开发者

Keras - Use neural network to play a game writed as function

开发者 https://www.devze.com 2022-12-07 17:37 出处:网络
I am new to machine learning and using neural networks with keras. I am trying to use reinforcement learning to build an AI that play game.

I am new to machine learning and using neural networks with keras. I am trying to use reinforcement learning to build an AI that play game. My game is a function that receive input (as array) and respond output (as array). Exemple:

import numpy as np
def my_function():
    turn = 0
    score = 0
    while turn < 2:
        env = np.random.rand(10,)
        print(env)
        a, b, c = input("Enter thr开发者_运维百科ee comma-separated values: ").split(",")
        score = score + sum( float(a)*env-float(b)*env + float(c)*env)
        turn = turn +1
    return(score)
d = my_function()
print(d)

(This is not my function but the input/output work the same)

Do you know how I set up my Keras to perform the best on my function ?

Thank you.

I have tryed to watch tutorials for keras, however they always use Pygame and a game displayed in a window as exemple.

0

精彩评论

暂无评论...
验证码 换一张
取 消