Oh thanks for pointing that out for me! I just got it fixed.
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)
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.
I think I have a very good idea for that…
What? Are you going to build it or something?
Yes of course my lovely ai friend
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.
I was planning on do that, first simple walking then just some dips and some other stuff
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!
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.
Your rag doll script for R6 is causing the arms to detach…
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!!
I think after that I understood it
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.
-
Each reward/punishment are separate.
-
We combine them together using math formula.
Which one you want to choose?
The distance (and color)
Uh, I don’t know, the easiest?
Thank you!!!
You mean the BasePart colour? or just generally?
It works perfectly fine for me
The color of the result of the raycast
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
[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
Ah thanks for pointing out that documentation error. I have fixed it.
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?