Skip to content

about the code update weight in the function updateWeights. #179

@lbgitjp

Description

@lbgitjp

the weight update code as below:

playground/src/nn.ts

Lines 357 to 358 in 02469bd

link.weight = link.weight -
(learningRate / link.numAccumulatedDers) * link.accErrorDer;

To better understand for beginners, the weight update code is better modified to:
link.weight = link.weight - learningRate * (link.accErrorDer / link.numAccumulatedDers) ;

I know the result is the same, but (link.accErrorDer / link.numAccumulatedDers) is easier to understand than (learningRate / link.numAccumulatedDers).

thanks.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions