我想在 R 中训练 n 个不同的神经网络parallel, 我怎样才能做到这一点?我对并行化相当陌生,所以我发现这有点困难。
这是我的 1 个网络的代码(到目前为止):
model<-keras_model_sequential()
# Define bulk of the network
model %>% layer_dense(units=Height,activation = "relu",input_shape = 1)
for(i in 1:Depth){
model %>% layer_dense(units=Height,activation = "relu",input_shape = 1)
}
# Readout Layer (ffNN)
model %>% layer_dense(units=1)
# Compile (ffNN)
model %>% keras::compile(loss="mse",
optimizer="adam",
metrics="mse")
## Report Model (Summary)
model %>% summary()
# Fit ffNN
fit.ffNN.start<-Sys.time()
fittedmodel<- model %>%
keras::fit(train_data,
trainingtarget,
epochs=epochs,
batch_size=(round(min(1,abs(Batch.size.percent))*nrow(train_data),digits = 0)), # Computes batch-size as a percentage of total data-size
)
fit.ffNN.end<-Sys.time()
None
本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系:hwhale#tublm.com(使用前将#替换为@)