# NOT RUN {
### Using mnist data again
data(mnist_data)
X1 = mnist_data$Images ### X1: 100 x 784 matrix
Y1 = mnist_data$Labels ### Y1: 100 x 1 vector
############################# Train Buddle
lst = TrainBuddle(Y1, X1, train.ratio=0.6, arrange=TRUE, batch.size=10, total.iter = 100,
hiddenlayer=c(20, 10), batch.norm=TRUE, drop=TRUE,
drop.ratio=0.1, lr=0.1, init.weight=0.1,
activation=c("Relu","SoftPlus"), optim="AdaGrad",
type = "Classification", rand.eff=TRUE, distr = "Logistic", disp=TRUE)
lW = lst[[1]]
lb = lst[[2]]
lParam = lst[[3]]
X2 = matrix(rnorm(20*784,0,1), 20,784) ## Genderate a 20-by-784 matrix
lst = FetchBuddle(X2, lW, lb, lParam) ## Pass X2 to FetchBuddle for prediction
# }
Run the code above in your browser using DataLab