artificial-intelligence

Game AI works powerfully on one side and becomes dumb on the other in Tic-Tac-Toe

笑着哭i 提交于 2020-06-23 18:06:08
问题 I am trying to make a Tic-Tac-Toe game in Python using PyGame and the MiniMax algorithm. The AI plays really well when given the first chance (playing as 'X'), but becomes dumb enough to help the user win when not given the first chance (playing as 'O'). I think I know what the problem is but changing it is messing with the whole program and is not going by the given docstrings. I've made two python files - one for the GUI (runner.py) and the other for the logic behind the game and the AI

Game AI works powerfully on one side and becomes dumb on the other in Tic-Tac-Toe

跟風遠走 提交于 2020-06-23 18:05:29
问题 I am trying to make a Tic-Tac-Toe game in Python using PyGame and the MiniMax algorithm. The AI plays really well when given the first chance (playing as 'X'), but becomes dumb enough to help the user win when not given the first chance (playing as 'O'). I think I know what the problem is but changing it is messing with the whole program and is not going by the given docstrings. I've made two python files - one for the GUI (runner.py) and the other for the logic behind the game and the AI

incorrect prediction Python ML

穿精又带淫゛_ 提交于 2020-06-17 09:07:34
问题 I want to get correct prediction result. Prediction is based on 5 values. When I had a 5 inputs with one values in every input, prediction was correct, but after changing structure to 1 input with 5 value in it, prediction became incorrect. I think it is due to select2 library. Maybe the other 4 values is not recognized, that`s why prediction is incorrect, but I don't fully understand. Code: app.py: import os import csv import prediction from flask import Flask, jsonify, make_response, render

Simple constraint programming solver

柔情痞子 提交于 2020-05-29 02:39:12
问题 I'm trying to get familiar with constraint programming. All documentation/videos I've seen so far just contain description of top-level concepts and code examples based on CP-libraries utilization (like Choko, Gecode, JaCoP etc). I'd like to implement at least something simple in Java without any libraries. Are there any resources where I can find working code in Java/C#/C++/Python which implements main CP ideas? (at least "send more money" problem solution). (or, maybe, if somebody can

LUIS: Adding patterns to intents is not taking any effect

独自空忆成欢 提交于 2020-05-28 06:35:07
问题 I followed what is described in the tutorial I first added an Pattern.any entity Next, I added a pattern for the required intent I had already created an intent like shown and now I click on train When I test, the intent is not hit Any idea what's missing? 回答1: The patterns are extremely literal. If the part of the phrase does not match exactly, the intent won't get recognized. (Note: you can add these phrases to the intent directly, instead of in the pattern, in which case it will recognize

Why does Monte Carlo Tree Search reset Tree

旧城冷巷雨未停 提交于 2020-05-25 07:25:12
问题 I had a small but potentially stupid question about Monte Carlo Tree Search. I understand most of it but have been looking at some implementations and noticed that after the MCTS is run for a given state and a best move returned, the tree is thrown away. So for the next move, we have to run MCTS from scratch on this new state to get the next best position. I was just wondering why we don't retain some of the information from the old tree. It seems like there is valuable information about the

Why does Monte Carlo Tree Search reset Tree

最后都变了- 提交于 2020-05-25 07:25:08
问题 I had a small but potentially stupid question about Monte Carlo Tree Search. I understand most of it but have been looking at some implementations and noticed that after the MCTS is run for a given state and a best move returned, the tree is thrown away. So for the next move, we have to run MCTS from scratch on this new state to get the next best position. I was just wondering why we don't retain some of the information from the old tree. It seems like there is valuable information about the

How does a system like Wolfram Alpha or Mathematica solve equations?

岁酱吖の 提交于 2020-05-22 16:09:13
问题 I'm building a web-based programming language partially inspired by Prolog and Haskell (don't laugh). It already has quite a bit of functionality, you can check out the prototype at http://www.lastcalc.com/. You can see the source here and read about the architecture here. Remember it's a prototype. Currently LastCalc cannot simplify expressions or solve equations. Rather than hard-coding this in Java, I would like to enhance the fundamental language such that it can be extended to do these

ValueError: non-broadcastable output operand with shape (3,1) doesn't match the broadcast shape (3,4)

☆樱花仙子☆ 提交于 2020-05-21 17:50:09
问题 I recently started to follow along with Siraj Raval's Deep Learning tutorials on YouTube, but I an error came up when I tried to run my code. The code is from the second episode of his series, How To Make A Neural Network. When I ran the code I got the error: Traceback (most recent call last): File "C:\Users\dpopp\Documents\Machine Learning\first_neural_net.py", line 66, in <module> neural_network.train(training_set_inputs, training_set_outputs, 10000) File "C:\Users\dpopp\Documents\Machine

How to Predict Employee task End_Date through machine-learning

馋奶兔 提交于 2020-05-14 09:07:44
问题 How to predict below and which algorithm is the best suit. Employee has Work Activity Start_Date & End_Date (Columns). Sheet has few other columns such as Work_Complexity (High & Low) , no. of sub-tasks for each activity. How to predict Work Activity End_Date for a Start_Date? Which ML Algorithm has to be used ? Is this can be considered as a realistic use case ? thanks!!! 回答1: Yes, this is a realistic use case. If you have a labelled data means, you have a sheet where employee start date and