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:


Attention formula:



Thursday, October 25, 2018

machine learning / deep learning 比较好的一些topic / trend


Topic:
  1. matrix factorization
  2. collaborative filtering 
  3. CTR预估
  4. one shot learning (单样本学习)+ 孪生网络
  5. 强化学习 RL
  6. 对抗生成网络 GAN
  7. GCN/GNN
  8. Meta-learning法。从先前的学习经验中提炼出基本的参数和结构配置。
  9. Transfer learning法。从先前的学习经验中提炼出可以重用的一些知识
  10. machine translation
  11. LSTM/GRU/GMU...
  12. Attention
  13. Transformer
  14. encoder-decoder
  15. factorization machine
  16. auto-encoder
  17. sequence to sequence
  18. copy net
  19. highway
  20. conventional/ recurrent / recursive neural network
  21. memory network/Neural Turing Machines
  22. Momentum

Method:
  1. DSSM
  2. Wide & Deep
  3. GAN各种变形
  4. FM各种变形
  5. GLU/GTU/GMU/GRU
  6. ResNet
  7. copynet
实验的trick:
  1. dropout
  2. L1/L2 正则
  3. batch norm 
  4. clip by norm/value
  5. learning rate decay
预处理语言模型:
word2vec, fasttext, glove, elmo, gpt, bert

Wednesday, September 19, 2018

tensorflow 理解

知乎上别人的专栏:https://www.zhihu.com/people/xi-xiang-yu-20/columns
dataset + estimator 以后把所有的输入部分转化成dataset 的模式。 estimator 是一个高层封装,可以调用一些基本方法。具体怎么用estimator,可以看 https://zhuanlan.zhihu.com/p/37586029

Monday, July 23, 2018

tensorflow GPU on server

指定GPU 一开始:
CUDA_VISIBLE_DEVICES=1 python test.py

安装指南:
https://blog.ailemon.me/2017/06/06/install-tensorflow-gpu-on-ubuntu-linux/

~/.bashrc 里面的东西
#cuda settings
export PATH=$HOME/cuda-8.0/bin:$PATH
export CPATH=$HOME/cuda-8.0/include:$CPATH
export LIBRARY_PATH=$HOME/cuda-8.0/lib64:$LIBRARY_PATH
export LD_LIBRARY_PATH=/$HOME/cuda-8.0/lib64:$LD_LIBRARY_PATH

Thursday, June 21, 2018

tensorflow useful functions

tf.add_n(): a list of tensors add
tf.assign(v,10): assign value 10 to a variable
#get variables function
tf.all_vaariables(): get all variables
tf.trainable_variables(): get all trainable variables
tf.concat(concat_dim, values, name='concat'): tf concatenation on the concat_dim dimension.
# get all collection variable keys
graph = tf.get_default_graph()
graph.get_all_collection_keys()
graph.get_tensor_by_name('mlp_b1:0') 

#get variable name
v.name

tf.train.batch(): 把数据分成一个一个的batch, 每个batch 中有batch_size 个数据
tf.name_scope() and tf.Variable_scope() 差不多,但是name_scope 对于tf.get_variable() 没影响。 这些都是用来方便管理的。可以在tensor board 可视化的时候更有帮助。

RNN中用的多的:
tf.clip_by_global_norm:用于控制梯度下降的参数。把梯度值控制在一个合理的范围内。