Where to start on creating a simple Neural network (for predicting)?

I want to create a basic Neural network to get started off learning Machine Learning. I don’t want to use someone else’s network I want to create mine from scratch. I need to know where I should start off keeping in mind that I only really know Lua and most tutorials are in C# and Python.

I would like my network to do something simple at first like predicting where a player is going to move next, or what key the player will press next. I have heard networks are actually quite simple so I would like it if you could try and explain in simple terms.

Thanks for the help.

I believe C# and I know Python have frameworks for creating Convolutional Neural Network models. You then have to feed the model as many examples of a particular thing as possible(ALOT) and test out different model weights etc… to improve accuracy. I’d be interested as well in an Lua based framework. In essence all the machine learning stuff boils down to building up a memory of pattern associations.

For example, certain patterns of key presses may be associated with other patterns and if certain patterns were pressed, then we can predict with % of accuracy the next pattern.

I would suggest first learning how to do this with other frameworks, then study that framework and attempt to replicate it in lua. I would imagine the Python frameworks at least have source code you can find and read.

Consider taking a look into this resource.

1 Like

To write a neural network, you first need data. That’s an input, preferably more than one column, and an output, just one item you want to predict. For example, your input might be user input and the output might be player direction. (This is a bad example because we can compute this without a neural net)

Of course, predicting future player inputs is actually going to be very hard, so I’d recommend picking something else.

Anyway, to get started you really need data. If you’re looking for machine learning stuff in general, try looking up genetic learning. This is a method more suited for game development which generates its own data.

3 Likes

I would like to look at reinforcement learning. What I really want to do is create an Machine Learning car.

It would start Driving Randomly at first until it finds a road then I would raycast down from all four wheels and if the Instance is not a road then it will be penalized, but if it is a road then it will be rewarded. The trouble is I do not know how to even start writing this machine learning/Neural network.

Okay. So in that situation, you could possible maintain a record of movements or series of movements performed by a vehicle and the results of those movement patterns. (Just spit balling here). That would provide a memory of successful movement patterns vs failed movement patterns. (possibly starting from a given position). Then have the vehicle choose a movement pattern (given its current position) that has the highest success chance, eventually the vehicle will learn which movement patterns are most successful given a particular starting point. Something along those lines

I do not know how to code that though, that is why I wanted some help creating the basics of a network to do something like that.

In Unity Reinforcement Learning is done via ML-Agents or something, i was wondering if it is possible to create something like ML-Agents?

Hey man, sorry i’m this late to respond, I actually moved off from roblox a few years ago and i’ve spent some good time studying AI/ML. Generally for Roblox, I do not recommend Reinforcement Learning at all, Computation time will be horrible and Roblox will end up giving you errors than results. Reinforcement Learning techniques also generally involve learning tons of college and university mathematical concepts.

Instead, what I want you to do is search up Perceptrons. They are the basics of the basics that will let you quickly understand how AI learns in 5 mins.

After that, what you really should be doing is learning about MLPs (Multi-Layered Perceptrons), a more computationally cost-efficient and generally a better alternative to what you are trying to do. I have tried out both RL and MLPs and to be honest, MLPs are better for your situation, not only can you train them with Genetic Algorithms easily, but you can also manually configure your AI by hand under a few minutes. Yes, the math is that simple and effective.

The equation for a perceptron is essentially this.

ActivationFunction(InputValue * Weight + Bias)

Learning all these topics should be very fast for you. I hope you are able to figure it out and implement it youself like you mentioned. :+1:

1 Like

Sorry. My library have solved these issues long time ago..

1 Like

Stop plugging your stupid modules in my forum thread

Yes a also completed this a long time ago using mlps adam regulators l1,l2 relu
thank you for being a person, namaste

Stupid, huh? Here’s a list of tutorials for you to compete against me. This is for me to dispute that short-sighted claim and to protect my reputation after you called it “stupid”.

High-Value Project Tutorials

Disclaimer

  • References that validates the use cases can be found here. It also includes my papers.

  • Additional use cases can be found here.

  • The “minimal implementation time” assumes that a junior gameplay machine learning engineer is handling the implementation.

Retention Systems

  • Creating Play Time Maximization Model

    • The model chooses actions or events that maximizes play time.

    • No need to add new content; the model can use existing content to optimize your games.

    • Have higher play time potential due to its ability to exploit and explore than the other models, but tend to be risky to use.

    • Minimal implementation takes a minimum of 2 hours using DataPredict™, especially if custom events are associated with the model’s output.

  • Creating Time-To-Leave Prediction Model

    • No need to add new content; the model can use existing content to optimize your games.

    • Minimal implementation takes a minimum of 30 minutes using DataPredict™.

  • Creating Probability-To-Leave Prediction Model

    • No need to add new content; the model can use existing content to optimize your games.

    • Minimal implementation takes a minimum of 30 minutes using DataPredict™.

  • Creating Left-Too-Early Detection Model

    • Inverse of probability-to-leave model by detecting outliers.

    • No need to add new content; the model can use existing content to optimize your games.

    • Highly exploitable if the player accumulates long session times over many sessions before suddenly decrease the session times gradually if rewards are involved.

    • Minimal implementation takes a minimum of 30 minutes using DataPredict™.

  • Creating Labelless Left-Too-Early Detection Model

    • Same as “Left-Too-Early Detection Model”, but it does not require manual tracking of label data, which makes it less accurate.

    • Minimal implementation takes a minimum of 30 minutes using DataPredict™.

  • Creating Engagement Milestone Detection Ensemble Model

    • Uses a combination of:

      • Time-To-Leave Prediction Model

      • Probability-To-Leave Prediction Model

      • Creating Left-Too-Early Detection Model

    • The model periodically checks if the player is playing much more longer or more engaged than usual.

    • Minimal implementation takes a minimum of 4 hours using DataPredict™.

  • Creating Play Time Maximization Ensemble Model

    • Uses a combination of:

      • Time-To-Leave Prediction Model

      • Probability-To-Leave Prediction Model

      • Play Time Maximization Model

    • Less risky than the original “Play Time Maximization Model”, but takes more time to implement.

    • Minimal implementation takes a minimum of 4 hours using DataPredict™.

Other systems include:

  • Recommendation System

  • Adaptive Difficulty System

  • Targeting System

  • AI-Players

  • Anti-Cheat System

which can be found here.

1 Like

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.