神经网络-输出收敛到0,python
我正在尝试使用简单的反向传播和一个热编码在多层神经网络中将2D数据分为3类。在我将增量学习改为批量学习后,我的输出收敛到0(神经网络-输出收敛到0,python,python,machine-learning,neural-network,backpropagation,Python,Machine Learning,Neural Network,Backpropagation,我正在尝试使用简单的反向传播和一个热编码在多层神经网络中将2D数据分为3类。在我将增量学习改为批量学习后,我的输出收敛到0([0,0,0]),主要是因为我使用了更多的数据或更高的学习速度。我不知道我是否必须派生出其他东西,或者我是否在代码中制造了一些bug for each epoch: #pseudocode for each input: caluclate hiden neurons activations (logsig) calculate ou
[0,0,0]
),主要是因为我使用了更多的数据或更高的学习速度。我不知道我是否必须派生出其他东西,或者我是否在代码中制造了一些bug
for each epoch: #pseudocode
for each input:
caluclate hiden neurons activations (logsig)
calculate output neurons activations (logsig)
#error propagation
for i in range(3):
error = (desired_out[i] - aktivations_out[i])
error_out[i] = error * deriv_logsig(aktivations_out[i])
t_weights_out = zip(*weights_out)
for i in range(hiden_neurons):
sum_error = sum(e*w for e, w in zip(error_out, t_weights_out[i]))
error_h[i] = sum_error * deriv_logsig(input_out[i])
#cumulate deltas
for i in range(len(weights_out)):
delta_out[i] = [d + x * coef * error_out[i] for d, x in zip(delta_out[i], input_out)]
for i in range(len(weights_h)):
delta_h[i] = [d + x * coef * error_h[i] for d, x in zip(delta_h[i], input)]
#batch learning after epoch
for i in range(len(weights_out)):
weights_out[i] = [w + delta for w, delta in zip(weights_out[i], delta_out[i])]
for i in range(len(weights_h)):
weights_h[i] = [w + delta for w, delta in zip(weights_h[i], delta_h[i])]
我会尝试一些玩具的例子,在那里我肯定NN将如何运行和调试我的代码。如果我确定我的代码是有效的NN,但仍然没有得到好的结果,我会尝试更改NN的参数。但它可能会非常耗时,因此我会选择一些更简单的ML技术,例如决策树,它不是像NN那样的黑盒。使用决策树,您应该更容易、更快地找到解决方案。问题是,除了NN,您是否可以实现它