Giter Site home page Giter Site logo

hw1_nn's Introduction

HW1_NN

Neural_Network文件夹说明

  • train.py:参数查找及训练,参数查找包括学习率,隐藏层大小,正则化强度

  • test.py:测试,导入模型,用经过参数查找后的模型进行测试,输出分类精度

  • loaddata.py:加载MNIST数据集的训练集和测试集

  • NN.py:定义两层神经网络,包含激活函数、反向传播,loss以及梯度的计算、学习率下降策略、L2正则化、优化器SGD

  • Data文件夹:原始MNIST数据集

输出文件

  • bestmodel.npz:参数查找后验证集acc最高的模型

  • loss_and_acc.png:bestmodel训练过程的loss,训练和验证过程的accuracy

  • visualize_weights.png:bestmodel的网络参数可视化

  • trainrecord.log:训练过程参数查找的记录

示例命令

进入到主文件夹:cd Neural_Network

训练

python train.py

程序将保存参数查找后的模型bestmodel.npz

绘制bestmodel训练过程的loss,训练和验证过程的accuracy情况并输出loss_and_acc.png

绘制bestmodel的网络参数并输出loss_and_acc.png

测试

python test.py

程序将导入模型bestmodel.npz并打印输出测试集上的accuracy

hw1_nn's People

Contributors

scc-bit avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.