-
Notifications
You must be signed in to change notification settings - Fork 449
FastNLP v0.2 #108
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
FastNLP v0.2 #108
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
* remove torchvision in requirements.txt
* refine interface of set_target & set_input * rename DataSet.Instance into DataSet.DataSetIter * remove unused methods in DataSet.DataSetIter * remove __setattr__ in DataSet; It is dangerous. * comment adjustment
* In init, detect content type to be Python int, float, or str. * In append(), check type consistence. * In init & append(), int will be cast into float if they occur together. * Map Python type into numpy dtype * Raise error if type detection fails.
* 添加fast_load_embedding方法,用vocab的词索引pre-trained中的embedding * 如果vocab有词没出现在pre-train中,从已有embedding中正态采样 Update embed_loader: * add fast_load_embedding method, to index pre-trained embedding with words in Vocab * If words in Vocab are not exist in pre-trained, sample them from normal distribution computed by current embeddings
* 添加fast_load_embedding方法,用vocab的词索引pre-trained中的embedding * 如果vocab有词没出现在pre-train中,从已有embedding中正态采样 Update embed_loader: * add fast_load_embedding method, to index pre-trained embedding with words in Vocab * If words in Vocab are not exist in pre-trained, sample them from normal distribution computed by current embeddings
* 添加Trainer参数metric_key,指明用来做模型选择的指标的名字 * 在Trainer添加处理tester返回的评价指标的逻辑,选择当前最好的模型
# Conflicts: # fastNLP/core/trainer.py
optimizer.SGD(lr=xxx);如果没有传入parameters,则在trainer中帮他加入parameter
…is to concat all data before calculation.
更新Optimizer: 多种初始化方法 1. SGD() 2. SGD(0.01) 3. SGD(lr=0.01) 4. SGD(lr=0.01, momentum=0.9) 5. SGD(model.parameters(), lr=0.1, momentum=0.9)
* 添加初始化注释 * 从_better_eval_result中抽取check metrics的逻辑到_check_eval_results函数
* remove unused codes in metrics.py * add tests for DataSet * add tests for FieldArray * add tests for metrics.py * fix predictor, add tests for predictor * fix bucket sampler, add tests for bucket sampler
* clean up unused codes
* add code comments * merge *_saver.py & *_loader.py in io/ * (ancient codes) rename Loss into LossFromTorch
* refine code style * fix tests * add a new tutorial
* add DataSet.get_field(), to fetch a FieldArray based on its name * remove old tutorials & add new tutorials
* remove conflicts * all tests passed
Codecov Report
@@ Coverage Diff @@
## master #108 +/- ##
===========================================
+ Coverage 40.66% 63.83% +23.17%
===========================================
Files 76 79 +3
Lines 4267 5262 +995
===========================================
+ Hits 1735 3359 +1624
+ Misses 2532 1903 -629
Continue to review full report at Codecov.
|
xpqiu
approved these changes
Dec 7, 2018
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
We are excited to announce that FastNLP of version 0.2.0 is released! 🎈 🎈
Please follow our latest tutorials for detailed introduction.
Documentation and more tutorials are under construction.
Thank @yhcc , @choosewhatulike , and @xuyige for their magnificent contribution!