- Jan 20, 2018
- 1,501
- 108
- 63
- 20
Skript Version: 2.2-dev37c
Skript Author: Bensku
Minecraft Version: Spigot 1.12.2
---
Full Code:
Errors on Reload:
none
Console Errors:
When using {_d}.addRow({_inp}, {_out}):
Other Useful Info:
So I'm trying to create a neural network in Skript using Neuroph, but somehow I can't get the DataSetRow constructor to work (or the DataSet addRow method) with skript-mirror
Javadocs DataSetRow (Constructor)
Javadocs DataSet (addRow 1, addRow 2)
I think it's a problem with the parameters, because I'm not entirely sure if this is how you should create a double array with skript-mirror.
Addons using (including versions):
skript-mirror 1.0.0
Troubleshooting:
Have you tried searching the docs? Yes
Have you tried searching the forums? Yes
What other methods have you tried to fix it? I tried a lot of things: not using DataSetRow (using addRow without DataSetRow), I tried multiple ways of setting the input and output variables, but I just can't get it to work
[doublepost=1543942598,1543761728][/doublepost]Fixed via Discord.
Solution: [new Double(0) and new Double(0) as Double] for the input and output variables
Thanks @EWS for this solution
EDIT: so another easier way is
Skript Author: Bensku
Minecraft Version: Spigot 1.12.2
---
Full Code:
code_language.skript:
import:
org.neuroph.core.NeuralNetwork
org.neuroph.core.data.DataSet
org.neuroph.core.data.DataSetRow
org.neuroph.core.transfer.Step
org.neuroph.nnet.Perceptron
java.lang.Double
java.util.Arrays
java.lang.System
command /test:
trigger:
set {_step} to new Step()
set {_nn} to new Perceptron(2, 1)
set {_d} to new DataSet(2, 1)
set {_inp} to Arrays.asList(new Double(0) and new Double(0))
set {_out} to Arrays.asList(new Double(0))
set {_dr} to new DataSetRow({_inp}, {_out})
# {_d}.addRow({_dr})
message "&cDataSetRow: &f%{_dr}%"
message "&cDataSet: %System.lineSeparator()%&f%{_d}%"
Errors on Reload:
none
Console Errors:
code_language.skript:
[Skript] No matching constructor: DataSetRow#<init> called with ([0.0, 0.0] (ArrayList), [0.0] (ArrayList))
code_language.skript:
[Skript] No matching method: DataSet#addRow called with ([0.0, 0.0] (ArrayList), [0.0] (ArrayList))
[Skript] Did you pass the wrong parameters? Here are the parameter signatures for addRow:
[Skript] * addRow(double[],double[])
[Skript] * addRow(double[])
[Skript] * addRow(org.neuroph.core.data.DataSetRow)
[Skript] Did you misspell the method? You may have meant to type one of the following:
[Skript] * add
[Skript] * addAll
Other Useful Info:
So I'm trying to create a neural network in Skript using Neuroph, but somehow I can't get the DataSetRow constructor to work (or the DataSet addRow method) with skript-mirror
Javadocs DataSetRow (Constructor)
Javadocs DataSet (addRow 1, addRow 2)
I think it's a problem with the parameters, because I'm not entirely sure if this is how you should create a double array with skript-mirror.
Addons using (including versions):
skript-mirror 1.0.0
Troubleshooting:
Have you tried searching the docs? Yes
Have you tried searching the forums? Yes
What other methods have you tried to fix it? I tried a lot of things: not using DataSetRow (using addRow without DataSetRow), I tried multiple ways of setting the input and output variables, but I just can't get it to work
[doublepost=1543942598,1543761728][/doublepost]Fixed via Discord.
Solution: [new Double(0) and new Double(0) as Double] for the input and output variables
Thanks @EWS for this solution
EDIT: so another easier way is
code_language.skript:
new DataSetRow([0, 0], [0])
Last edited: