Wednesday, June 12, 2019
vim 总结
toturial: https://vimhelp.org/
vim - A modal editor based on the classic ‘vi’ editor by Bill Joy.
Vim quick reference
Changing modes
Enter command mode: :
Enter typing mode: i (insert at cursor), a (append after cursor), A (append at end of line)
Exit command or typing mode: ESC
Moving (you must not be in command or typing mode)
By line or column: use the arrow keys or h (left), j (down), k (up), l (right)
Go to beginning/end of line: 0 or $
Go to beginning/end of file: 1G or G
Go to particular line: type the linenumber and press G
Prev/next word: gE or W
Beginning/end of word: e or b
Search: /search term or regex
Opening, saving and closing files
Open a file: :e filename or path
Save and exit: :x
Save without exiting: :w
Exit without saving: :q!
Getting help
In-editor help: :help
The less command allows you to use these key-commands to move around the file
x
Monday, June 10, 2019
如何半自动安装python package
全自动: pip install xxx
半自动:一些python package 有setup.py xx install . 可以follow 这些instruction
如果没有write access 到site-package 这种系统路径,需要把package 安装到自己设定的路径下面去,具体参考网页https://docs.python.org/2.7/install/index.html#alternate-installation
举例来说,
python setup.py install --home=/home/ec2-user/workspaces/hoverboard-workspaces/lib
此时,需要把当前目录装在PYTHONPATH里面去,
如果在断网的情况下pip install package, 为了避免平台问题(比如amazon hoverboard),需要先把package 所有依赖的源代码下载下来,然后再安装。具体见:
https://www.cnblogs.com/jay54520/p/8330994.html
https://www.jianshu.com/p/f8a3f3a07aff
https://blog.csdn.net/pierre_/article/details/54234151
http://imshuai.com/python-pip-install-package-offline-tensorflow/
如果感觉没有问题,比如wheel 文件适合当前平台的话,可以download 对应的whl文件,然后通过
pip install --user -v --no-index "${WHEELS_LOC}certifi-2018.11.29-py2.py3-none-any.whl"
进行安装
半自动:一些python package 有setup.py xx install . 可以follow 这些instruction
如果没有write access 到site-package 这种系统路径,需要把package 安装到自己设定的路径下面去,具体参考网页https://docs.python.org/2.7/install/index.html#alternate-installation
举例来说,
python setup.py install --home=/home/ec2-user/workspaces/hoverboard-workspaces/lib
此时,需要把当前目录装在PYTHONPATH里面去,
vim ~/.bashrc
PYTHONPATH=~/one/location:$PYTHONPATH
PYTHONPATH=~/second/location:$PYTHONPATH
export PYTHONPATH
source ~/.bashrc
如果有其他依赖的话,还需要安装其他依赖package.如果在断网的情况下pip install package, 为了避免平台问题(比如amazon hoverboard),需要先把package 所有依赖的源代码下载下来,然后再安装。具体见:
https://www.cnblogs.com/jay54520/p/8330994.html
https://www.jianshu.com/p/f8a3f3a07aff
https://blog.csdn.net/pierre_/article/details/54234151
http://imshuai.com/python-pip-install-package-offline-tensorflow/
如果感觉没有问题,比如wheel 文件适合当前平台的话,可以download 对应的whl文件,然后通过
pip install --user -v --no-index "${WHEELS_LOC}certifi-2018.11.29-py2.py3-none-any.whl"
进行安装
Thursday, December 27, 2018
tensorflow 炼丹trick
为什么loss 或者学习的参数 在summary 中会出现nan?
可能是由于梯度爆炸引起的。解决方法:1. gradient clip 2. batch nomalization 3, 降低学习率 4. 加入正则。
参考文献:
https://blog.csdn.net/qq_33485434/article/details/80733251
https://blog.csdn.net/qq_25737169/article/details/78847691
https://cloud.tencent.com/developer/article/1057071
https://blog.csdn.net/yinxingtianxia/article/details/78121037
https://www.jianshu.com/p/cc42a9a45a71
https://www.zhihu.com/question/49346370
如果你想查看ckpt中的网络结构和参数该怎么弄呢?这里提供2种方法。 一是用tensorflow官方源码中自带的inspect_checkpoint.py 给个例子如下: python /usr/local/lib/python2.7/dist-packages/tensorflow/python/tools/inspect_checkpoint.py --file_name=model.ckpt-158940 --tensor_name=unit_1_1/conv1/Weights 如果你只用了file_name这个参数,那么看到的就是整体网络结构。如果你2个参数都用了,那看到的就是具体那一层的值
可能是由于梯度爆炸引起的。解决方法:1. gradient clip 2. batch nomalization 3, 降低学习率 4. 加入正则。
参考文献:
https://blog.csdn.net/qq_33485434/article/details/80733251
https://blog.csdn.net/qq_25737169/article/details/78847691
https://cloud.tencent.com/developer/article/1057071
https://blog.csdn.net/yinxingtianxia/article/details/78121037
https://www.jianshu.com/p/cc42a9a45a71
https://www.zhihu.com/question/49346370
如果你想查看ckpt中的网络结构和参数该怎么弄呢?这里提供2种方法。 一是用tensorflow官方源码中自带的inspect_checkpoint.py 给个例子如下: python /usr/local/lib/python2.7/dist-packages/tensorflow/python/tools/inspect_checkpoint.py --file_name=model.ckpt-158940 --tensor_name=unit_1_1/conv1/Weights 如果你只用了file_name这个参数,那么看到的就是整体网络结构。如果你2个参数都用了,那看到的就是具体那一层的值
Tuesday, December 25, 2018
LSTM and attention
LSTM:
references:
http://blog.gdf.name/lstm-with-tensorflow/
https://blog.csdn.net/Jason160918/article/details/78295423
https://blog.csdn.net/xuanyuansen/article/details/61913886
https://www.jianshu.com/p/b6130685d855
formula:
references:
http://blog.gdf.name/lstm-with-tensorflow/
https://blog.csdn.net/Jason160918/article/details/78295423
https://blog.csdn.net/xuanyuansen/article/details/61913886
https://www.jianshu.com/p/b6130685d855
formula:
Attention formula:
Thursday, November 15, 2018
Thursday, November 1, 2018
Thursday, October 25, 2018
machine learning / deep learning 比较好的一些topic / trend
Topic:
- matrix factorization
- collaborative filtering
- CTR预估
- one shot learning (单样本学习)+ 孪生网络
- 强化学习 RL
- 对抗生成网络 GAN
- GCN/GNN
- Meta-learning法。从先前的学习经验中提炼出基本的参数和结构配置。
- Transfer learning法。从先前的学习经验中提炼出可以重用的一些知识
- machine translation
- LSTM/GRU/GMU...
- Attention
- Transformer
- encoder-decoder
- factorization machine
- auto-encoder
- sequence to sequence
- copy net
- highway
- conventional/ recurrent / recursive neural network
- memory network/Neural Turing Machines
- Momentum
Method:
- DSSM
- Wide & Deep
- GAN各种变形
- FM各种变形
- GLU/GTU/GMU/GRU
- ResNet
- copynet
- dropout
- L1/L2 正则
- batch norm
- clip by norm/value
- learning rate decay
预处理语言模型:
word2vec, fasttext, glove, elmo, gpt, bert
Subscribe to:
Posts (Atom)





