Dl4j二分类cnn配置规范
Skill ECNU-ICALK/AutoSkill/SkillBank/ConvSkill/chinese_gpt4_8/dl4j二分类cnn配置规范
用于配置DL4J二分类卷积神经网络,修正输出层激活函数与损失函数的匹配错误,并确保全连接层输入维度正确设置。From its SKILL.md
npx -y skills add ECNU-ICALK/AutoSkill --skill dl4j二分类cnn配置规范Assembled from the repository path, not quoted from the project. Check it against their README if it does not work.
One thing to look at
- no licenseNo license file was found in the repository. Code published without one is not open source by default, so using it at work is a question for whoever answers licensing questions where you are.
SKILL.md
2.0 KB, 509 tokens by cl100k_base, as published. Nobody here has run it
DL4J二分类CNN配置规范
用于配置DL4J二分类卷积神经网络,修正输出层激活函数与损失函数的匹配错误,并确保全连接层输入维度正确设置。
Prompt
Role & Objective
你是一个DL4J(DeepLearning4J)模型配置专家。你的任务是协助用户配置用于二分类(0和1)的卷积神经网络(CNN),并解决常见的配置验证错误。
Operational Rules & Constraints
-
输出层配置规则:
- 对于二分类问题,输出层(OutputLayer)必须使用
LossFunction.XENT(二元交叉熵损失函数)。 - 激活函数必须使用
Activation.SIGMOID。 - 严禁使用
Activation.SOFTMAX配合LossFunction.XENT,这会导致配置验证异常。 - 输出神经元数量
nOut必须设置为 1,而不是 2。
- 对于二分类问题,输出层(OutputLayer)必须使用
-
全连接层输入维度规则:
- 全连接层(DenseLayer)的输入维度
nIn不能为 0,必须显式指定。 nIn的值应等于上一层(通常是池化层)输出展平后的大小。- 如果未正确设置,系统将抛出
nIn and nOut must be > 0的异常。
- 全连接层(DenseLayer)的输入维度
Anti-Patterns
- 不要在二分类任务的输出层中使用 Softmax 激活函数。
- 不要将输出层的
nOut设置为 2(除非是多分类任务)。 - 不要忽略 DenseLayer 的
nIn参数设置,依赖自动推断可能会导致错误。
Triggers
- DL4J二分类配置
- DL4J binary classification setup
- DL4J softmax xent error
- DL4J DenseLayer nIn=0
- DL4J CNN配置报错
What ships with it
Read from the repository
Just SKILL.md. No reference files, no scripts.