增加参数说明

This commit is contained in:
李大鹏 2023-12-04 11:25:50 +08:00
parent 931c37abc5
commit 6a02f30d7f
3 changed files with 22 additions and 12 deletions

View File

@ -8,17 +8,16 @@ import org.wlld.rnnNerveCenter.NerveManager;
import org.wlld.rnnNerveEntity.SensoryNerve;
import org.wlld.tools.IdCreator;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import java.util.concurrent.locks.ReentrantReadWriteLock;
public class RecommendCodeManager {//推荐id管理
private NerveManager nerveManager;
private double studyTh;
private int dim;
private ReentrantReadWriteLock lock = new ReentrantReadWriteLock();
private final NerveManager nerveManager;
private final double studyTh;
private final int dim;
private final ReentrantReadWriteLock lock = new ReentrantReadWriteLock();
public RecommendCodeManager(boolean initPower, RecommendConfig recommendConfig) throws Exception {
studyTh = recommendConfig.getStudyTh();

View File

@ -275,13 +275,14 @@ public class NerveJumpManager {
* @param hiddenDepth 隐层深度
* @param activeFunction 激活函数
* @param isDynamic 是否是动态神经元
* @param studyPoint 学习率
* @param rzType 正则函数
* @param lParam 正则系数
* @throws Exception 如果参数错误则抛异常
*/
public NerveJumpManager(int sensoryNerveNub, int hiddenNerveNub, int outNerveNub
, int hiddenDepth, ActiveFunction activeFunction, boolean isDynamic,
double studyPoint, int rzType, double lParam) throws Exception {
double studyPoint, int rzType, double lParam) throws Exception {
if (sensoryNerveNub > 0 && hiddenNerveNub > 0 && outNerveNub > 0 && hiddenDepth > 0 && activeFunction != null) {
this.hiddenNerveNub = hiddenNerveNub;
this.sensoryNerveNub = sensoryNerveNub;
@ -384,7 +385,14 @@ public class NerveJumpManager {
}
rnnOutNerveBodies.add(rnnOutNerveBody);
}
/**
* 初始化残差Rnn神经元(跳层)参数
*
* @param initPower 是否是首次进行训练
* @param isShowLog 是否打印续写过程中的参数
* @param toSoftMax 是否增加softMax输出层
* @throws Exception 如果参数错误则抛异常
*/
public void initRnn(boolean initPower, boolean isShowLog, boolean toSoftMax) throws Exception {
isRnn = true;
initDepthNerve(false, 0, 0);//初始化深度隐层神经元

View File

@ -23,11 +23,14 @@ public class SensoryNerve extends Nerve {
}
/**
* @param eventId 唯一的事件id
* @param parameter 输入点的数据
* @param isStudy 是否是学习 (学习状态没有输出)
* @param E 标注
* @param outBack 回调结果
* @param eventId 唯一的事件id每个用户线程一个id用来处理线程安全
* @param parameter 该输入层的输入参数
* @param isStudy 是否是学习 (学习状态没有输出)
* @param E 标注
* @param outBack 回调结果
* @param isEmbedding 是否获取word2Vec返回结果(单独为词向量嵌入兼容若无需则传false)
* @param rnnMatrix rnn参数矩阵矩阵中每一行是每一层的特征向量
* @param storeys 记录跳层路径的数组即在rnn中经过的层数若不在此路径集合内则跳跃
*/
public void postMessage(long eventId, double parameter, boolean isStudy, Map<Integer, Double> E
, OutBack outBack, boolean isEmbedding, Matrix rnnMatrix, int[] storeys) throws Exception {//感知神经元输出