指定“初始权重"用于 R 编程神经网络中的 nnet [英] specifying "initial weights" for nnet in R programming neural network

查看:24
本文介绍了指定“初始权重"用于 R 编程神经网络中的 nnet的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

在 R 编程中,我想了解如何使用 nnet 来让用户指定初始权重而不是运行神经网络算法的默认值?R 文档提到了以下参数.关于如何使用权重的任何示例?

In R programming,I am trying to understand how to use nnet to have user specified initial weights instead of defaults for running a neural network algorithm? The R documentation mentions below arguments. Any example of how to use weights?

nnet(formula, data, weights, ...,
subset, na.action, contrasts = NULL)

推荐答案

自定义权重应具有以下形式:

The custom weights shall have the following form:

weights <- c(

 BH1, I1H1, I2H1, .., InH1,
 BH2, I1H2, I2H2, .., InH2,
 ...
 BHn, I1Hn, I2Hn, .., InHn,
 BO,
 I1Out, .., InOut)

c(
 weights from bias & inputs to 1st hidden unit,
 from bias & inputs to second hidden unit H2,
 from bias & inputs to last hidden unit Hn,
 biast of output unit,
 skip layer weights ( if any)
 )

问候

附言请记住将所有与一个单位相关的权重的标准偏差保持在 1.0 以下.否则你的单位会很快饱和.

P.S. Remember to keep standard deviation of all weights connected to a unit below 1.0. Otherwise you will get units saturated pretty fast.

这篇关于指定“初始权重"用于 R 编程神经网络中的 nnet的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆