Comments (5)
不好意思我没看完 你的softmax在crossentropyloss里面了我没仔细看
from numpy_neural_network.
我在你代码的基础上,加了一层全连接之后,为什么会出现测试训练准确率一直10% 左右的情况呢,loss 也不下降,是因为你的代码没有加正则化的原因吗?谢谢
调整了学习率,也不收敛。
去掉一层,却可以收敛,97%在群里。为什么呢?
from numpy_neural_network.
@yangzhaonan18 推测是梯度消失了,将weights_scale=1e-3改为1e-2就可以了.以下是我增加一个fc层后的测试的结果
epoch:0 step:0 ; loss:2.3025979253964155
train_acc:0.21875; val_acc:0.0991
epoch:0 step:500 ; loss:2.2866856309392967
train_acc:0.15625; val_acc:0.1064
epoch:0 step:1000 ; loss:1.1675340534531413
train_acc:0.59375; val_acc:0.3591
epoch:0 step:1500 ; loss:0.4990171329343591
train_acc:0.90625; val_acc:0.8664
epoch:1 step:0 ; loss:0.359293357114892
train_acc:0.96875; val_acc:0.8764
epoch:1 step:500 ; loss:0.19083221860863414
train_acc:1.0; val_acc:0.9237
epoch:1 step:1000 ; loss:0.0747052528886187
train_acc:1.0; val_acc:0.9476
epoch:1 step:1500 ; loss:0.08739012776302801
train_acc:1.0; val_acc:0.9513
epoch:2 step:0 ; loss:0.03666094344819661
train_acc:1.0; val_acc:0.9543
epoch:2 step:500 ; loss:0.26946484791939
train_acc:0.96875; val_acc:0.9538
epoch:2 step:1000 ; loss:0.05818703805948156
train_acc:1.0; val_acc:0.961
from numpy_neural_network.
@yangzhaonan18 推测是梯度消失了,将weights_scale=1e-3改为1e-2就可以了.以下是我增加一个fc层后的测试的结果
epoch:0 step:0 ; loss:2.3025979253964155 train_acc:0.21875; val_acc:0.0991 epoch:0 step:500 ; loss:2.2866856309392967 train_acc:0.15625; val_acc:0.1064 epoch:0 step:1000 ; loss:1.1675340534531413 train_acc:0.59375; val_acc:0.3591 epoch:0 step:1500 ; loss:0.4990171329343591 train_acc:0.90625; val_acc:0.8664 epoch:1 step:0 ; loss:0.359293357114892 train_acc:0.96875; val_acc:0.8764 epoch:1 step:500 ; loss:0.19083221860863414 train_acc:1.0; val_acc:0.9237 epoch:1 step:1000 ; loss:0.0747052528886187 train_acc:1.0; val_acc:0.9476 epoch:1 step:1500 ; loss:0.08739012776302801 train_acc:1.0; val_acc:0.9513 epoch:2 step:0 ; loss:0.03666094344819661 train_acc:1.0; val_acc:0.9543 epoch:2 step:500 ; loss:0.26946484791939 train_acc:0.96875; val_acc:0.9538 epoch:2 step:1000 ; loss:0.05818703805948156 train_acc:1.0; val_acc:0.961
我下载了代码按照步骤跑,发现有报错 尝试改了还是这个问题,请问还有这个代码方便发一份吗
x.shape:(16, 1, 28, 28),y.shape:(16, 10)
Traceback (most recent call last):
File "train.py", line 81, in
from nn.optimizers import SGD
File "/data/wangtao/numpy_neural_network/nn/optimizers.py", line 12, in
from modules import Model
File "/data/wangtao/numpy_neural_network/nn/modules.py", line 15, in
from optimizers import *
File "/data/wangtao/numpy_neural_network/nn/optimizers.py", line 12, in
from modules import Model
ImportError: cannot import name 'Model'
from numpy_neural_network.
@yangzhaonan18 所有代码均已上传,请参照readme先编译
cd numpy_neuron_network
python setup.py build_ext -i
from numpy_neural_network.
Related Issues (7)
- Formula can't show HOT 3
- sigmoid_backward函数是不是写错了 HOT 2
- 有试过用tensorflow的模型跑一跑么? HOT 7
- nn文件夹的layers.py中第300行函数名称有误 HOT 1
- 激活函数Tanh的反向传播 HOT 3
- 多分类损失函数 梯度那里没看懂 HOT 2
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from numpy_neural_network.