Giter Club home page Giter Club logo

mini_lm_lstm's Introduction

Mini Language Model by LSTM

这是一个微型的语言模型,由PyTorch实现,并由LSTM进行建模,并可以自定义模型深度

训练

训练可直接运行train.py文件,同时项目也提供了一些参数可供选择,示例代码如下所示:

python train.py --n_step 5 \
                --hidden_size 128 \
                --batch_size 128 \
                --learning_rate 0.0005 \
                --epochs 5 \
                --embed_size 256 \
                --epochs_save 5 \
                --data_dir data/dataset \
                --num_layers 1 \
                --ckpt_dir model/ckpt

正确性验证

项目将实现的LSTM模型与PyTorch库时间的模型输出进行比较,可以通过在命令行中输入以下命令运行并比较结果,如果想修改初始的参数或者输入维度,可以直接修改代码文件。

python model/lstm.py

结果

项目对比了实现的LSTM语言模型的运行结果,具体如下所示,也可以在plot_result.ipynb文件中查看,所有的结果均由手动记录,项目并不提供保存结果的代码。

initialization_pplvalid_ppl_layers

test_ppl_layer

报告

报告文件在report目录中

mini_lm_lstm's People

Contributors

reason-wang avatar

Stargazers

 avatar

Watchers

 avatar  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.