renamed neuron trainable to trainableBias
This commit is contained in:
parent
1d80c4fec3
commit
0541a08c68
@ -245,10 +245,10 @@ namespace NanoBrain.Unity {
|
|||||||
neuron.bias = newBias;
|
neuron.bias = newBias;
|
||||||
}
|
}
|
||||||
|
|
||||||
bool newTrainable = EditorGUILayout.Toggle("Trainable", neuron.trainable);
|
bool newTrainable = EditorGUILayout.Toggle("Trainable", neuron.trainableBias);
|
||||||
if (newTrainable != neuron.trainable) {
|
if (newTrainable != neuron.trainableBias) {
|
||||||
anythingChanged = true;
|
anythingChanged = true;
|
||||||
neuron.trainable = newTrainable;
|
neuron.trainableBias = newTrainable;
|
||||||
}
|
}
|
||||||
|
|
||||||
EditorGUIUtility.labelWidth = previousLabelWidth;
|
EditorGUIUtility.labelWidth = previousLabelWidth;
|
||||||
|
|||||||
@ -50,7 +50,7 @@ namespace NanoBrain {
|
|||||||
/// <summary>
|
/// <summary>
|
||||||
/// Indicator whether the bias can be trained
|
/// Indicator whether the bias can be trained
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public bool trainable = false;
|
public bool trainableBias = false;
|
||||||
|
|
||||||
#region Synapses
|
#region Synapses
|
||||||
|
|
||||||
@ -281,7 +281,7 @@ namespace NanoBrain {
|
|||||||
/// <param name="clone"></param>
|
/// <param name="clone"></param>
|
||||||
protected virtual void CloneFields(Neuron clone) {
|
protected virtual void CloneFields(Neuron clone) {
|
||||||
clone.bias = this.bias;
|
clone.bias = this.bias;
|
||||||
clone.trainable = this.trainable;
|
clone.trainableBias = this.trainableBias;
|
||||||
clone.persistOutput = this.persistOutput;
|
clone.persistOutput = this.persistOutput;
|
||||||
clone.combinator = this.combinator;
|
clone.combinator = this.combinator;
|
||||||
clone.activator = this.activator;
|
clone.activator = this.activator;
|
||||||
@ -678,7 +678,7 @@ namespace NanoBrain {
|
|||||||
synapse.BackPropagation(this, derivative, learningRate);
|
synapse.BackPropagation(this, derivative, learningRate);
|
||||||
|
|
||||||
// Bias
|
// Bias
|
||||||
if (this.trainable) {
|
if (this.trainableBias) {
|
||||||
// This does not work well, because the derivative/error does not have a 3D direction
|
// This does not work well, because the derivative/error does not have a 3D direction
|
||||||
// float3 biasDerivative = derivative; // dSSR/dActivator
|
// float3 biasDerivative = derivative; // dSSR/dActivator
|
||||||
// switch (activator) { // dActivator/dBias
|
// switch (activator) { // dActivator/dBias
|
||||||
@ -706,7 +706,7 @@ namespace NanoBrain {
|
|||||||
synapse.BackPropagation(this, derivative.magnitude, learningRate);
|
synapse.BackPropagation(this, derivative.magnitude, learningRate);
|
||||||
|
|
||||||
// Bias
|
// Bias
|
||||||
if (this.trainable) {
|
if (this.trainableBias) {
|
||||||
switch (this.activator) { // dActivator/dBias
|
switch (this.activator) { // dActivator/dBias
|
||||||
case ActivationType.Linear:
|
case ActivationType.Linear:
|
||||||
derivative *= 1;
|
derivative *= 1;
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user