Tensorflow-cheatSheet

卷积padding参数

参考stackoverflow上的问答,输入向量长13,卷积核长6,步长5,以此为例:

  • "VALID" = without padding:

    1
    2
    3
    inputs:         1  2  3  4  5  6  7  8  9  10 11 (12 13)
    |________________| dropped
    |_________________|
  • "SAME" = with zero padding:

    1
    2
    3
    4
    5
                pad|                                      |pad
    inputs: 0 |1 2 3 4 5 6 7 8 9 10 11 12 13|0 0
    |________________|
    |_________________|
    |________________|

安装TF旧版本

用pip安装Python2.7 TF0.11,参考stackoverflow回答

1
2
3
4
5
# Ubuntu/Linux 64-bit, CPU only, Python 2.7
export TF_BINARY_URL=https://storage.googleapis.com/tensorflow/linux/cpu/tensorflow-0.11.0-cp27-none-linux_x86_64.whl
# GPU版本
# export TF_BINARY_URL=https://storage.googleapis.com/tensorflow/linux/gpu/tensorflow-0.11.0-cp27-none-linux_x86_64.whl
pip install --ignore-installed --upgrade $TF_BINARY_URL