Questions tagged [ai]

Artificial intelligence (AI) is the branch of computer science and technology that studies the development of machines able to simulate aspects of human intelligence.

Filter by
Sorted by
Tagged with
4 votes
2 answers
286 views

Simple version of NEAT

I have wrote my own simple version of NEAT and want to improve the code for mainly performance (training and runtime of a generation). This simple version of NEAT aims to perform somewhere near as ...
coder's user avatar
  • 121
2 votes
1 answer
34 views

One-layer linear neural network to solve a regression problem in PyTorch

Good morning everyone, I am trying to figure out how deep learning works. My approach is mainly theoretical but I have decided to code a few deep learning projects to get a better feel of the kind of ...
francescoriccardocrescenzi's user avatar
2 votes
0 answers
34 views

A simple word embedder only using jax

How can this code be improved? I'm a novice programmer trying to learn ml by doing it from scratch. This code is part of a transformer model that I'm working on. Do you have any ideas about how to ...
T3st's user avatar
  • 21
3 votes
1 answer
231 views

GUI Tic Tac Toe game with UNBEATABLE AI players

This is an updated version of my Tic Tac Toe game with AI players, it is related to GUI Tic-Tac-Toe game with six AI players - part 1: the UI. But that question is more than two weeks old and no one ...
Ξένη Γήινος's user avatar
0 votes
0 answers
54 views

Running a neural network backwards

I've read this paper where they basically run a network backwards. And decided to try. Luckily, many useful functions are implemented already in pytorch. The main idea is this: Write a convnet Write ...
Minsky's user avatar
  • 249
1 vote
0 answers
63 views

Search Stack Overflow and GitHub for code in a specified language

This code is designed to scrape Stack Overflow and GitHub, pulling information based on a user-specified programming language and processing the data into a format for AI learning. It uses a number of ...
Robert3737's user avatar
1 vote
0 answers
50 views

Improving AI model for categorical outcome predictions

I am a novice and would appreciate some guidance. I have been trying to create a machine learning code that will correlatate 10+ binary variable and maybe a couple continuous variables to a binary ( ...
Parker Car's user avatar
3 votes
0 answers
296 views

Generic Monte Carlo Tree Search implementation in Rust

I'm working on a project where I need a strong AI for a combinatoric game, and decided to go with Monte Carlo Tree Search because the specific game will be original to the project - no good heuristics ...
crass_sandwich's user avatar
3 votes
3 answers
142 views

Visitor Pattern to handle human and AI responses

Let's suppose there is a method of an Inputter class that queries many questions. The Human inputter would have to answer all ...
prestokeys's user avatar
  • 1,371
2 votes
1 answer
266 views

Minimax method for Tic Tac Toe

I have this program for minimax tic tac toe ...
Abdulahad Ghuman's user avatar
2 votes
1 answer
213 views

C++ Connect 4 in SFML

After a substantial amount of programming experience in high level languages like Javascript and Python, I decided to try learning a low level language for once, so I did C++. As my first project I ...
Kotetsu Chan's user avatar
8 votes
1 answer
879 views

Making this python chess engine faster

I've implemented a chess engine using the python chess move generation library (which I assumed to be reasonably fast), and have implemented various optimisation techniques for search and move ...
ZED's user avatar
  • 91
2 votes
0 answers
71 views

CodeReview: CycleGAN Implementation Using Keras FunctionalAPI

Okay So I Am Here Implementing the cyclegan architecture with using keras api from scratch. For Those who Wanna Know More About Cyclegan seehere The CycleGan Compose of Two Phase Architecture Like ...
CallMeAaishaa's user avatar
2 votes
2 answers
1k views

C++ - Tic Tac Toe AI powered by minmax algorithm

This was my previous post on Tic Tac Toe in C++. I received very good feedback and tried to implement all of the improvements. I could not implement some due to the AI needed functions or complexity. ...
Random_Pythoneer59's user avatar
2 votes
0 answers
74 views

minmax evaluation with alpha beta pruning [closed]

I'm making some small board game and wanted to code a very simple greed AI with this algorithm. It turns out it doesn't play the most greedy moves, it is simply not working. I'd appreciate any ...
rdar1999's user avatar
2 votes
0 answers
46 views

Optimize binary classification model

I've created binary classification model from scratch, just to understand intuition behind that. However when I compare my implementation to model from tensorflow/pytorch with the same parameters and ...
mikolaj semeniuk's user avatar
1 vote
0 answers
180 views

A little board game framework with MCTS AI

There are two main classes: Game and MCTSPlayer. The first one is just an abstract class with a couple of methods and some hints ...
Rennorb's user avatar
  • 121
2 votes
0 answers
48 views

Generator and Encoder network model [closed]

https://arxiv.org/pdf/2009.07047v1.pdf I don't have a lot of experience in building a network model. I would like to build the Encoder and ...
Alex's user avatar
  • 121
3 votes
1 answer
101 views

Constraining monotonicity in the loss function during training

I have a neural network that I am training on a loss function composed of two terms (i.e. loss = loss1 + loss2). Ideally, I would like for both ...
Mathews24's user avatar
  • 131
6 votes
2 answers
4k views

TicTacToe with AI in C

I recently started learning C, though I have some experience in other languages. I recently wrote a TicTacToe AI using the Minimax Algorithm in C. I would like to know how I could write better C. <...
kprogrammer's user avatar
13 votes
3 answers
394 views

MMMRjs a product of BYTES Genesis

We have published a product today called MMMR.js this product is licensed under the MIT license and is built by Syed Mohammad Sannan. The uniqueness of this product is that it is built with and for ...
Syed M. Sannan - alt's user avatar
1 vote
1 answer
71 views

AI agent fails when aligned with its target

I'm making an AI agent (blue entity) that pursues a target (green entity) while avoiding an obstacle (red entity). The code works as it should most of the times, but will fail if all the entities are ...
superlaks's user avatar
  • 269
1 vote
2 answers
345 views

A simple AI for Tic-Tac-Toe game

This is an AI class that takes an array of the board as an argument, and plays the best move after evaluating the board and gets a win rate. I haven't used any java package to do this. How can I make ...
Anmol Agrawal's user avatar
7 votes
1 answer
376 views

Hill Climbing Egg Holder function - escaping local extrema

Here is the Egg Holder function for \$m\$ dimensions: $$\displaystyle f(x)=\sum_{i=1}^{m-1}\left[-(x_{i+1}+47)\sin\sqrt{|x_{i+1}+x_i /2 + 47|} -x_i \sin\sqrt{|x_i - (x_{i+1}+47)|}\right]$$ I am ...
gator's user avatar
  • 455
5 votes
1 answer
5k views

Minimax algorithm for tic tac toe in Python

I am using minimax algorithm (for now without alpha beta pruning) for AI in tic tac toe game in Python and Numpy. It's working, but very slow, so I would like to optimize it. A few rules for current ...
Michal's user avatar
  • 203
4 votes
1 answer
59 views

FIrst time trying tree classifier in python

Recentely I have started teaching myself some basic AI concepts and this was my first attemp at using a random forest in order to classify the iris data set. It would be great if anyone could give me ...
Apol's user avatar
  • 41
8 votes
1 answer
342 views

Minimax implementation of tic tac toe

I have the following working tic tac toe program. Someone said it's a convoluted mess and I'm looking for pointers on how to clean it up. ...
DCR's user avatar
  • 275
6 votes
1 answer
340 views

Improved first Tic-Tac-Toe + Minimax AI

Posted my first attempt at Tic-Tac-Toe a second ago here. Got a lot of great and helpful responses. The main things I took away from these responses was to use spell check, and to keep things simple. ...
swaltek's user avatar
  • 415
4 votes
0 answers
462 views

Chess AI Using Minimax and Alpha-Beta Pruning

I am working on a Chess AI using chess.js, and currently, it can run 3 layers in under 10 seconds, but 4 or more takes minutes. How can I optimize my current code to be able to run 4 or 5 layers, or ...
CannotCode's user avatar
3 votes
2 answers
2k views

Tic-Tac-Toe Player vs Computer

I have created a logical AI for a Tic-Tac-Toe game. I want a review about how good or bad it is. Here the computer AI will defend all your attacks as well as try to attack whenever it gets a chance. <...
Akshay soni's user avatar
2 votes
0 answers
298 views

Initializing Reinforcement Learning Q-Table State Space-Python

The code below is a "World" class method that initializes a Q-Table for use in the SARSA and Q-Learning algorithms. Without going into too much detail, the world has "Pickups" and "Dropoffs" that can ...
Rezkin's user avatar
  • 161
6 votes
1 answer
3k views

Tic-Tac-Toe with changeable board size (Part 1)

Part 2: Tic-Tac-Toe with changeable board size (Part 2) I've created a Tic-Tac-Toe program with python which has a option to change a standard 3x3 board to NxN board. I've also created easy, hard and ...
Sriv's user avatar
  • 2,730
6 votes
1 answer
2k views

JavaFX Connect Four AI

I made a Connect Four AI with minimax algorithm. It's my first bigger JavaFX project. Any help for improvements would be really appreciated. Board: ...
Marten's user avatar
  • 585
4 votes
1 answer
216 views

A command-line unbeatable Tic-Tac-Toe written in C

I'm trying to learn programming and this Tic-Tac-Toe is one of my first projects. The user gets to start first as 'x' or second as 'o'. Please give me any criticism you find on the code and give ...
Udhay Sankar's user avatar
2 votes
1 answer
76 views

Game AI to slow to work

I have written some python code to play this scratch game. But it is to slow to function correctly because each frame if it clicks, it takes a screenshot of almost the same thing like this ...
Menotdan's user avatar
3 votes
0 answers
1k views

A simple toy ResNet model and its implementation

I want to understand how resnet works also called us residual networks and I understand it better when I code one myself. I tried to find a simple implementation of resnet in the web but most I found ...
Eka's user avatar
  • 349
6 votes
1 answer
600 views

Chess engine programmed in Python

I programmed a chess AI in Python. It uses the alpha-beta algorithm with move ordering. I want it to be able to look further than depth 4, without increasing calculation time. I am wondering how I ...
John Dornbierer's user avatar
0 votes
1 answer
472 views

Could someone check the Minimax Algorithm correctly implemented? [closed]

I'm working on AI tic-tac-toe that computer make a move and I wanted to know that I correctly implemented the minimax algorithm. Please someone check my code to identify a problem or any kind of bug. ...
Samad Farooq's user avatar
3 votes
2 answers
117 views

Genesis, an AI that learns as you talk to it

This is a programming challenge I set for myself a while back to create an AI that starts with no knowledge of anything whatsoever, and learns as you talk to it. (It can learn stuff like your name, ...
Genesis's user avatar
  • 31
2 votes
0 answers
304 views

Repetitive Tic-Tac-Toe AI game with Python 3

I have a text based Tic-Tac-Toe game with a simple AI element that will take winning moves and block losing moves. The one piece of criticism I received was that I was 'hard coding' too much. I can ...
Robert's user avatar
  • 55
8 votes
5 answers
945 views

Tic Tac Toe in C w/ ncurses Revision

Someone in this thread said I could ask for a review of my revision: Ncurses Tic Tac Toe with simplistic AI I re-wrote it from scratch using the suggestions from the answers. In particular I did the ...
some_guy632's user avatar
4 votes
1 answer
264 views

Tic tac toe with unbeatable AI

I wrote this simple command line interface tic tac toe game with unbeatable AI with unittests. Looking for any suggestions how to improve it. Game: ...
dan-klasson's user avatar
15 votes
3 answers
1k views

Ncurses Tic Tac Toe with simplistic AI

I have read your rules and in particular the part about bite-sized portions, so I am apprehensive about posting this but want to do it anyway. I have recently begun getting into C and in particular ...
some_guy632's user avatar
3 votes
1 answer
3k views

C++ Battleship player AI

Found this project online and looking for some guidance. I'm in the process of developing a Battleship AI that will play against different computer difficulties. The "barebones" part of the project ...
Caleb J.'s user avatar
3 votes
1 answer
140 views

Filling up a hand with random cards that are not yet drawn - Monte Carlo

I would like to know if there is a more efficient way to speed up below code. This function is meant to fill in a set of poker hand with the remaining cards using Mersenne Twister for a Monte Carlo ...
Tomashiwa's user avatar
4 votes
1 answer
333 views

Offline .io style game built in Unity

I am creating a .io style game through Unity and it's coming along nicely. This is my first time working with Unity, and my first time using C#; I have been a Java coder. Could you good people tell me ...
Clint's user avatar
  • 101
2 votes
0 answers
199 views

Simple Neural Network from scratch using NumPy (Python)

I added learning rate and momentum to a neural network implementation from scratch I found at: https://towardsdatascience.com/how-to-build-your-own-neural-network-from-scratch-in-python-68998a08e4f6 ...
Seb Squire's user avatar
0 votes
2 answers
892 views

Battleships “AI” function

I would like some advice on how I could shorten my function from my battleships game (below). Essentially what it does is it checks if a coordinate is a hit and if it is, then if checks adjacent ...
Simon's user avatar
  • 9
3 votes
1 answer
1k views

MiniMax Algorithm

This is my C implementation of the Minimax Algorithm to play tic-tac-toe. I consider myself a C beginner so any feedback on style, best practices, or efficiency is more than welcome. ...
aonemd's user avatar
  • 145
6 votes
0 answers
1k views

2048 AI in Python 3

I am working on an 2048 AI and this is my code so far. In the game 2048 you have a 4x4 grid in that some random so named tiles spawn. Each tile has a number. The lowest number is 2. By using the left,...
codeglow's user avatar

1
2 3 4 5