PyDL博客学习50问之2

P1-https://www.cnblogs.com/BlueBlueSea/p/11041565.html

1.tf.get_variable()的使用

https://blog.csdn.net/UESTC_C2_403/article/details/72327321

2.tf.get_variable tf.placeholder 的区别

https://blog.csdn.net/newchenxf/article/details/79503057(好文)

前者存可训练的模型参数,后者是输入需feed。

3.tf中的tensor如何理解,既包含数据又包含op?

import tensorflow as tf
a=tf.Variable(1)
b=tf.constant(1)  #定义变量a=1和常量1,并且定义a的自加运算aplus1和更新a的值得操作update"""
aplus1=tf.add(a,b)
update=tf.assign(a,aplus1)
a=a.assign_add(b)

#设置完变量之后,必须要对变量进行初始化工作,变量才能使用
init=tf.global_variables_initializer()
with tf.Session() as sess:
    sess.run(init) #运行初始化变量的计算
    for i in range(10): #循环10次,查看a逐渐自加1的结果
        #sess.run(update) #执行变量a的自加运算
        print(sess.run(a)) #打印变量a也需要用session.run

 4.tf.concat学习

https://blog.csdn.net/leviopku/article/details/82380118

只要明白axis的含义就很简单了。

5. tf.sequence_mask学习

https://applenob.github.io/tf_10.html (好文)

6. tf.cond学习

https://blog.csdn.net/m0_37041325/article/details/76908660

7.tf.expand_dims学习

https://www.cnblogs.com/helloworld0604/p/9001703.html

https://stackoverflow.com/questions/39008821/tensorflow-when-use-tf-expand-dims

9.tf.identity学习

https://blog.csdn.net/hu_guan_jie/article/details/78495297

10.tf.summary学习

https://www.cnblogs.com/lyc-seu/p/8647792.html

11.tf中GraphKeys

https://blog.csdn.net/hustqb/article/details/80398934

12.tf.control_dependencies和tf.GraphKeys.UPDATE_OPS

https://blog.csdn.net/huitailangyz/article/details/85015611

13.python中栈和队列

https://blog.csdn.net/imzoer/article/details/8663695

可用列表实现

17.py中使用numpy计算各种距离

https://blog.csdn.net/qq_19707521/article/details/78479532

18.python二维列表赋值问题

https://blog.csdn.net/zzc15806/article/details/82629406

19.pathlib库的Path类的使用

https://blog.csdn.net/amanfromearth/article/details/80265843

20.tf的日志记录

https://www.jianshu.com/p/249e9913d22c

21.npz和npy文件

https://www.cnblogs.com/Lilu-1226/p/9768368.html

22.tf.transpose函数的用法讲解

 https://blog.csdn.net/cc1949/article/details/78422704

 24.查看torch的GPU版本是否安装成功:

import torch
print(torch.cuda.is_available())

 25.super.__init__()避免显式调用基类

https://stackoverflow.com/questions/38586279/what-do-supermyobject-self-init-do-in-class-myobject-init-functio

原文地址:https://www.cnblogs.com/BlueBlueSea/p/11178475.html