Questions tagged [java]

For questions about implementation of Machine Learning and Artificial Intelligence algorithms in the Java programming language.

Java is a general-purpose computer-programming language that is concurrent, class-based, object-oriented, and specifically designed to have as few implementation dependencies as possible. It is intended to let application developers "write once, run anywhere" (WORA), meaning that compiled Java code can run on all platforms that support Java without the need for recompilation. Java applications are typically compiled to bytecode that can run on any Java virtual machine (JVM) regardless of computer architecture. As of 2016, Java is one of the most popular programming languages in use, particularly for client-server web applications, with a reported 9 million developers. Java was originally developed by James Gosling at Sun Microsystems (which has since been acquired by Oracle Corporation) and released in 1995 as a core component of Sun Microsystems' Java platform. The language derives much of its syntax from C and C++, but it has fewer low-level facilities than either of them.

Building AI with Java - Letzgro

9 questions
5
votes
2 answers

Neural Network with varying inputs (for a game ai)

I want to create a simple game which basically consists of 2d circles shooting smaller circles at each other (to make hitbox detection easier for the start). My goal is to create an ai which adapts its own behaviour to the player‘s. For that, i want…
Cr3ative
  • 53
  • 4
3
votes
1 answer

How do I apply reinforcement learning to a game with infinitely many actions?

I am trying to figure out how to use a reinforcement learning algorithm, if possible, as a "black box" to play a game. In this game, a player has to avoid flying birds. If he wants to move, he has to move the mouse on the display, which controls the…
TVSuchty
  • 263
  • 3
  • 11
2
votes
1 answer

Fitness function in genetic algorithm based on an interval

I am writing an app, where when a ball is shot from a canon it is supposed to land in a hole that is on a given distance. The ball is supposed to land between the distance of the beginning of the hole and the end of the hole. The size of the hole is…
ivaa14
  • 21
  • 1
2
votes
1 answer

Generate Image with Artificial intelligence

I am pretty new to Artificial Intelligence programming, however i do understand the basic concept. I have an idea in my mind: Import a JPEG Image, Convert this Image into a 2D Array (x,y values + r g b values). Then create a second array with…
videokate
  • 31
  • 3
1
vote
1 answer

Connect 4 minimax does not make the best move

I'm trying to implement an algorithm that would choose the optimal next move for the game of Connect 4. As I just want to make sure that the basic minimax works correctly, I am actually testing it like a Connect 3 on a 4x4 field. This way I don't…
wesleyy
  • 113
  • 4
1
vote
0 answers

How do I write a genetic algorithm to solve the knapsack problem?

I am trying to write a genetic algorithm that generates 100 items, assigning random weights and utilities to them. And then try to pick items how out these 100 items while maximising the utility and not picking items over 500ks. The program should…
Donald
  • 11
  • 2
0
votes
1 answer

Huge variations in epoch count for highest generalized accuracy in CNN

I have written my own basic convolutional neural network in Java as a learning exercise. I am using it to analyze the MIT CBCL face database image set. They are a set of 19x19 pixel greyscale images. Network specifications are: Single Convolution…
MikeB
  • 11
  • 4
0
votes
1 answer

Multi-layer network only predicts linear trends

I have made a neural network from scratch (in java), which is refusing to switch out of linear regression. I have pushed up the layer sizes (it now has 2 hidden layers, both with 5 neurons), and yet when given harsh sloping polynomials to train on,…
0
votes
1 answer

Simple Polynomial Gradient Descent algorithm not working

I am trying to implement a simple 2nd order polynomial gradient descent algorithm in Java. It is not converging and becomes unstable. How do I fix it? public class PolyGradientDescent { public static double getValue(double input) { return 3 *…