DataPredict [Release 1.21] - General Purpose Machine Learning And Deep Learning Library (Learning AIs, Generative AIs, and more!)

Oh thanks for pointing that out for me! I just got it fixed.

3 Likes

self learning walking ai when?.. (i want to see highly advanced walking methods since the current one i use always falls down when colliding with something on a high speed like a table)

3 Likes

Haha. Calm down. I was doing some bug fixing lately related to this library. I don’t want any bugs appear and break the AI while training.

While, I am doing that, I am figuring out what should the obstacle course looks like for the AI.

3 Likes

I think I have a very good idea for that…

1 Like

What? Are you going to build it or something?

1 Like

Yes of course my lovely ai friend :troll:

2 Likes

Suit yourself then, but if it is too hard, it is going to have trouble training.

I recommend you do simple ones at the start then make it progressively harder.

1 Like

I was planning on do that, first simple walking then just some dips and some other stuff

1 Like

I would find it helpful if you can provide an example like the base of a self learning pet/ enemy because I think the documentation isn’t that clear for some people.But overall great creation!

2 Likes

Hmm, not sure how you managed to not see the source code for that (but for simple environment). So, I moved the stuff near the documentation link so that people don’t accidentally skip over it.

Also added very basic neural network with reinforcement learning tutorial. Didn’t want to make things very complicated for complete beginners by adding those kind of examples.

1 Like

Your rag doll script for R6 is causing the arms to detach…

1 Like

How can I give the AI 10 Raycast as input and then let it decide between 7 at least one and maximum 4 to select ( The 4 may contain only backward or forward and only left or right and of the other two both maximum). And punish it that it
a) lives (little)
b) if she touches a certain part (a lot)
c) if it touches another specific part (a lot)
d) is too fast
and reward
a) reached a goal
I have read through the documentation, but I don’t really understand it, so I don’t have much of a clue, can you please help me? Thank you!!:heart:

I think after that I understood it

1 Like

Question, when you say “Raycast as input”, which stuff are we using? The distance, instance or something else?

Also there like two ways ways of punishing/rewarding it.

  1. Each reward/punishment are separate.

  2. We combine them together using math formula.

Which one you want to choose?

1 Like

The distance (and color)
Uh, I don’t know, the easiest?
Thank you!!!

1 Like

You mean the BasePart colour? or just generally?

2 Likes

It works perfectly fine for me

1 Like

The color of the result of the raycast

1 Like

Hi, when I run this code this error comes up:

local LogisticRegression = MDLL.Models.LogisticRegression
local LogisticRegressionModel = LogisticRegression.new()
local featureMatrix = {

	{1, 0,  0},
	{1, 10, 2},
	{1, -3, -2},
	{1, -12, -22},
	{1, 2,  2},
	{1, 1,  1},
	{1,-11, -12},
	{1, 3,  3},
	{1, -2, -2},

}
local labelVectorLogistic = {

	{1},
	{1},
	{0},
	{0},
	{1},
	{1},
	{0},
	{1},
	{0}

}
LogisticRegressionModel:train(featureMatrix, labelVectorLogistic)
local testData = {

	{90, 90}

}
local predictedVector = LogisticRegressionModel:predict(testData)
print(predictedVector)
--#Error
 10:24:17.123  Iteration: 500		Cost: 0.058439104568566616  -  Server - BaseModel:149
  10:24:17.124  ServerScriptService.AqwamRobloxMatrixLibrary:231: Argument 1 and 2 are incompatible! (1, 2) and (3, 1)  -  Server - AqwamRobloxMatrixLibrary:231
  10:24:17.124  Stack Begin  -  Studio
  10:24:17.124  Script 'ServerScriptService.AqwamRobloxMatrixLibrary', Line 231 - function dotProduct  -  Studio - AqwamRobloxMatrixLibrary:231
  10:24:17.124  Script 'ServerScriptService.AqwamRobloxMachineAndDeepLearningLibrary.Models.LogisticRegression', Line 227 - function predict  -  Studio - LogisticRegression:227
  10:24:17.124  Script 'ServerScriptService.AI2', Line 36  -  Studio - AI2:36

Screenshot 2023-08-30 103141

[Edit:]
Solution:

local testData = {

	{90, 90,0}

}

But:
,I will give you a test data for you to use. The value of prediction should be 1."
It prints a table

2 Likes

Ah thanks for pointing out that documentation error. I have fixed it.

2 Likes

Hi, when I run this code this error comes up:

local DataPredict = require(game.ServerScriptService.DataPredictLibrary) 
local DQN = DataPredict.Models.QLearningNeuralNetwork.new() -- Create a new model object.

DQN:createLayers({4, 3, 2}) -- Setting up our layers.
DQN:setClassesList({"Up", "Down"}) -- Setting up our classes.
local reward = 0
wait(10)
local oldposition = game.Workspace:WaitForChild("Misterx114"):FindFirstChild("HumanoidRootPart").Position.X
DQN:setPrintReinforcementOutput(true)
while true do
	local playerposition = game.Workspace:WaitForChild("Misterx114"):FindFirstChild("HumanoidRootPart").Position.X
	local environmentFeatureVector = playerposition
	print(environmentFeatureVector)
	if not (playerposition >= 50) then
		if playerposition == oldposition then
			reward = -1
		else
			reward = playerposition - oldposition
		end
	else
		reward = 50
	end
	oldposition = game.Workspace:WaitForChild("Misterx114"):FindFirstChild("HumanoidRootPart").Position.X
	local actionLabel = DQN:reinforce(environmentFeatureVector, reward) -- Run the reinforce() function.
	if actionLabel == "Up" then
		game.Workspace:WaitForChild("Misterx114"):FindFirstChild("HumanoidRootPart").Position.X += 1
	else
		game.Workspace:WaitForChild("Misterx114"):FindFirstChild("HumanoidRootPart").Position.X -= 1
	end
	wait(0.1)
end
--#Error
  11:38:28.651  29.999969482421875  -  Server - AI2:94
  11:38:28.654  Current Number Of Episodes: 1		Current Epsilon: 0.5  -  Server - QLearningNeuralNetwork:239
  11:38:28.654  Up  -  Server - AI2:106
  11:38:28.757  29.999969482421875  -  Server - AI2:94
  11:38:28.758  ServerScriptService.DataPredictLibrary.Models.NeuralNetwork:348: attempt to get length of a number value 

Is the code idea the right approach?