示例#1
0
func NeuronRemoveBias(neuron *ng.Neuron) (bool, MutateResult) {
	if neuron.Bias != 0 {
		neuron.Bias = 0
		return true, nil
	}
	return false, nil
}
示例#2
0
func NeuronAddBias(neuron *ng.Neuron) (bool, MutateResult) {
	if neuron.Bias == 0 {
		neuron.Bias = RandomBias()
		return true, nil
	}
	return false, nil
}
func possiblyPerturbBias(neuron *ng.Neuron, probability float64, saturationBounds []float64) bool {
	didPerturb := false
	if rand.Float64() < probability {
		bias := neuron.Bias
		perturbedBias := perturbParameter(bias, saturationBounds)
		neuron.Bias = perturbedBias
		logg.LogTo("DEBUG", "bias %v -> %v", bias, perturbedBias)
		didPerturb = true
	}
	return didPerturb
}