【问题标题】:Stabilizing Neural Network稳定神经网络
【发布时间】:2015-05-10 20:14:35
【问题描述】:

我正在尝试构建一个神经网络并拥有以下代码:

for i = 1:num_samples-num_reserved

        % Getting the sample and transposing it so it can be multiplied
        sample = new_data_a(:,i)';

        % Normalizing the input vector
        sample = sample/norm(sample);

        % Calculating output
        outputs = sample*connections;

        % Neuron that fired the hardest's index (I) and its output (output)
        [output, I] = max(outputs);

        % Conections leading to this neuron
        neuron_connections = connections(:,I);

        % Looping through input components
        for j = 1:num_features

            % Value of this input component
            component_input = sample(j);

            % Updating connection weights
            delta = 0.7*(component_input - neuron_connections(j));

            neuron_connections(j) = neuron_connections(j) + delta;


        end


        % Copying new connection weights into original matrix
        connections(:,I) = neuron_connections/norm(neuron_connections);

        if(rem(i,100) == 0)

            if(I == 1)

                delta_track = [delta_track connections(2,I)];

            end

        end

        % Storing current connections



    end

我认为我做的一切都是正确的。这个循环重复大约 600 次,以便逐步更新连接。我正在使用的更新权重的功能是我在教科书中找到的标准功能。

但是,当我查看存储在 delta_track 中的值时,这些值会不断振荡,形成规则模式。

有什么建议吗?

【问题讨论】:

    标签: matlab neural-network


    【解决方案1】:

    您可以减少反馈因素。然后网络可能需要更多时间来学习,但不太可能发生振荡。 另一种常见的技术是添加衰减,即每次迭代都减少因子。 一般来说,神经网络具有与控制系统相同的稳定性规则(因为只要神经网络正在学习它就是一个控制系统)因此类似的方法适用于例如PID 控制器。

    【讨论】:

    • 谢谢 - 我会实现这两种技术 :) 你认为我的整体方法有什么问题吗?
    • 我同意让学习率衰减是一个好方法。这是一个非常标准的做法。当您接近解决方案时,它可以帮助您更精确地收敛。
    • 感谢@Fookie,将反馈因子设置为 1/n,其中 n 是工作的测试“轮数”:)
    • 下一步通常是评估其他学习机制。现在你有一个(相当快的)衰减。在 n 的 delta 高于 n-1 之后,一些人开始减少因子。有些人进行进化学习。前面有很多乐趣等着你。
    猜你喜欢
    • 2020-02-21
    • 2018-03-23
    • 2020-12-21
    • 2017-02-19
    • 2014-01-15
    • 1970-01-01
    • 2021-02-07
    • 1970-01-01
    • 2015-07-11
    相关资源
    最近更新 更多