d1.dl.RBM.fit <- function(DT){
...
}
d1.dl.RBMstack.fit <- function(f,DT,bin=F){
return(darch(
darch.bootstrap = F,
darch.fineTuneFunction = "backpropagation",
darch.isBin = bin,
darch.numEpochs = 100,
rbm.numEpochs = 0, #pretrain
layers = c(33,40,4,50,2),
rbm.allData = F,
rbm.batchSize = 3,
bp.learnRat = 0.1,
normalizeWeights = T,
normalizeWeightsBound = 5,
darch.dropout = 0.2,
darch.dither = T,
darch.weightDecay = 0.0001
)
)
}
d1.dl.RBMstack.predict <- function(test,model,y){
if (bin==T){
predictions <- predict(darch, type="bin")
numCorrect <- sum(predictions == test[,eval(parse(text=y))])
cat(paste0("Correct classifications on all data: ", numCorrect,
" (", round(numCorrect/nrow(trainTargets)*100, 2), "%)\n"))
} else {
predictions <- predict(model, type="bin")
}
}
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.