#๐Ÿ”’ tensorflow IA

4 messages ยท Page 1 of 1 (latest)

rough linden
#

hello i'm trying to do a IA for a game named "push over". I'm new in IA coding so i dont understand a lot of thing i do. The game looks like these (random game position).
XOXX
OOXX
XXXO
XOOO

there is 2 players, X and O, and you game push one piece of yours from every side but it will change the line or column. If i'm O and i put one in the second column, it'll looks like this :
XOXX
OOXX
XOXO
XXOO

here is my code :

import tensorflow as tf

model = tf.keras.models.Sequential()
model.add(tf.keras.layers.Dense(17, activation="relu"))
model.add(tf.keras.layers.Dense(289, activation="relu"))
model.add(tf.keras.layers.Dense(2, activation="softmax"))

model.compile(loss="sparse_categorical_crossentropy",
optimizer="sgd",
metrics=["accuracy"])

model.fit(entree, target, epochs=1)

entree and target are the databases i did for the IA. It is some position of the game, the player who played and if the position is winning or not (not optimal but enought to get started). It looks like something like this : entree = [["X", "O", "X", "O", "O", "O", "X", "X", "O", "X", "X", "O", "O", "O", "X", "X", "X"], ...], target = ["W", "L", "L", "W", ...].

It returns a lot of things that i dont understand so if someone could help me, it would be nice

spiral socketBOT
#

@rough linden

Python help channel opened

Remember to:

  • Ask your Python question, not if you can ask or if there's an expert who can help.
  • Show a code sample as text (rather than a screenshot) and the error message, if you've got one.
  • Explain what you expect to happen and what actually happens.

:warning: Do not pip install anything that isn't related to your question, especially if asked to over DMs.

spiral socketBOT
#

@rough linden

Python help channel closed

This help channel has been closed and it's no longer possible to send messages here. If your question wasn't answered, feel free to create a new post in #1035199133436354600. To maximize your chances of getting a response, check out this guide on asking good questions.