よろしくお願いします。ディープ ラーニング ニューラル ネットワークを実装して、多数の変数 (一種の多変量非線形回帰) を予測しようとしています。最初のステップとして、R で Darch パッケージを見て、コード スニペットを調べています。
http://cran.r-project.org/web/packages/darch/darch.pdf
p 10 から次のコードを実行すると、「排他的 OR」でトレーニングしているように見えますが、結果のニューラル ネットワークは関数を学習できないようです。(1,0) パターンまたは (0,1) パターンのいずれかを true として学習しますが、両方を学習することはありません。私の理解では、これらの種類のネットワークは、初心者向けの「排他的または」を含め、ほぼすべての機能を学習できるはずであるということでした。これは、このネットワークが微調整で利用する元の逆伝播作業によって解決されませんでした。私は何かが欠けている可能性があると思うので、何かアドバイスや助けをいただければ幸いです。(エポックを 10,000 まで増やしましたが、役に立ちませんでした。)
# Generating the datasets
inputs <- matrix(c(0,0,0,1,1,0,1,1),ncol=2,byrow=TRUE)
outputs <- matrix(c(0,1,1,0),nrow=4)
# Generating the darch
darch <- newDArch(c(2,4,1),batchSize=2)
# Pre-Train the darch
darch <- preTrainDArch(darch,inputs,maxEpoch=100)
# Prepare the layers for backpropagation training for
# backpropagation training the layer functions must be
# set to the unit functions which calculates the also
# derivatives of the function result.
layers <- getLayers(darch)
for(i in length(layers):1){
layers[[i]][[2]] <- sigmoidUnitDerivative
}
setLayers(darch) <- layers
rm(layers)
# Setting and running the Fine-Tune function
setFineTuneFunction(darch) <- backpropagation
darch <- fineTuneDArch(darch,inputs,outputs,maxEpoch=100)
# Running the darch
darch <- darch <- getExecuteFunction(darch)(darch,inputs)
outputs <- getExecOutputs(darch)
cat(outputs[[length(outputs)]])
## End(Not run)
#### Example results
> cat(outputs[[length(outputs)]])
0.02520016 0.8923063 0.1264799 0.9803244
## Different run
> cat(outputs[[length(outputs)]])
0.02702418 0.1061477 0.9833059 0.9813462