cjlin1 / simpleNN

BSD 3-Clause "New" or "Revised" License
48 stars 16 forks source link

Newton method without LM (Python) #13

Open monkey1208 opened 4 years ago

monkey1208 commented 4 years ago

Does any one encounter the problem that when using newton method without LM(--lambda 0) causes the line search routine endless? The if condition to break the while loop at Line 417 won't be satisfied(a positive float will never be less than or equal to a negative float).

Or is there some mistakes in my training parameters below? (The seed does not matter.)

python3 train.py --optim NewtonCG \
        --net CNN_4layers \
        --bsize 1024 \
        --train_set ./data/mnist-5000.mat \
        --val_set ./data/mnist/mnist.t.mat \
        --dim 28 28 1 \
        --seed 1209 \
        --GNsize 500 \
        --iter_max 100 \
        --lambda 0 \
cjlin1 commented 4 years ago

If you have time could you try if for the matlab code the same problem occurs?

On 2020-06-01 02:41, 楊力權 wrote:

Does any one encounter the problem that when using newton method without LM(--lambda 0) causes the line search routine endless? The if condition to break the while loop at Line 417 won't be satisfied.

Or is there some mistake of my training parameters below?

python3 train.py --optim NewtonCG \ --net CNN_4layers \ --bsize 1024 \ --train_set ./data/mnist-5000.mat \ --val_set ./data/mnist/mnist.t.mat \ --dim 28 28 1 \ --seed 1209 \ --GNsize 500 \ --iter_max 100 \ --lambda 0 \

-- You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub [1], or unsubscribe [2]. [ { "@context": "http://schema.org", "@type": "EmailMessage", "potentialAction": { "@type": "ViewAction", "target": "https://github.com/cjlin1/simpleNN/issues/13", "url": "https://github.com/cjlin1/simpleNN/issues/13", "name": "View Issue" }, "description": "View this Issue on GitHub", "publisher": { "@type": "Organization", "name": "GitHub", "url": "https://github.com" } } ]

Links:

[1] https://github.com/cjlin1/simpleNN/issues/13 [2] https://github.com/notifications/unsubscribe-auth/ABI3BHTZSMUBG5OVYDJOIWTRUKQGPANCNFSM4NPIVQJQ

monkey1208 commented 4 years ago

The matlab code works.