Closed AliyuAziz closed 8 years ago
Hello,
thanks for your feedback. You are using the old darch 0.9.1 interface functions which have changed in 0.10.0 and are only used internally now. Please use the darch
function to create and train your networks, e.g.
library(darch)
inputs <- matrix(c(0,0,0,1,1,0,1,1),ncol=2,byrow=TRUE)
outputs <- matrix(c(0,1,1,0),nrow=4)
darch <- darch(inputs, outputs, c(2,4,1), rbm.batchSize = 2, rbm.genWeightFunc = generateWeights, rbm.numEpochs = 1000, darch.numEpochs = 0)
Feel free to ask further questions if anything is unclear.
Hello saviola777,
Many thanks for your quick response. I have been trying to the example script you provider but I am still getting new error in rbm@ messages as follows:
> library(darch)
> inputs <- matrix(c(0,0,0,1,1,0,1,1),ncol=2,byrow=TRUE)
> outputs <- matrix(c(0,1,1,0),nrow=4)
> darch <- darch(inputs, outputs, c(2,4,1), rbm.batchSize = 2,
+ rbm.genWeightFunc = generateWeights, rbm.numEpochs = 1000,
+ darch.numEpochs = 0)
WARN [2016-03-30 21:06:46] gputools package not available, using CPU matrix multiplication.
INFO [2016-03-30 21:06:46] Constructing a darch with 3 layers.
INFO [2016-03-30 21:06:46] Generating RBMs.
INFO [2016-03-30 21:06:46] Construct new RBM instance with 2 visible and 4 hidden units.
INFO [2016-03-30 21:06:46] Construct new RBM instance with 4 visible and 1 hidden units.
INFO [2016-03-30 21:06:46] Start DArch pre-training
INFO [2016-03-30 21:06:46] Starting the training of the rbm with 2 visible and 4 hidden units.
Error in rbm@hiddenUnitFunction(rbm, getVisibleUnitStates(rbm), hiddenBiases, :
unused argument (rbm.genWeightFunc = function (numUnits1, numUnits2)
{
ret <- matrix(rnorm(numUnits1 * numUnits2) * 0.1, numUnits1, numUnits2)
return(ret)
})
>
>
Kindly assist.
Ah yes, my bad, the parameter is actually called rbm.genWeightFunction
, so it should be
darch <- darch(inputs, outputs, c(2,4,1), rbm.batchSize = 2, rbm.genWeightFunction = generateWeights, rbm.numEpochs = 1000, darch.numEpochs = 0)
But since generateWeights
is the default value anyway, you can also leave this parameter out.
Many thanks saviola777, you are the best! Everything works fine now. Best regards
Hello,
I am learning Bayesian Models in R for the first time using darch package. However, I am getting an error which I am not sure whether it's due to R or the package. Kindly help.
The simple code is as follows:
and the error:
Best regards Aziz