![](https://img-blog.csdnimg.cn/20201014180756922.png?x-oss-process=image/resize,m_fixed,h_64,w_64)
py
kekeshu_k
这个作者很懒,什么都没留下…
展开
-
plt的subplots_adjust绘图
add_subplot(self, *args, **kwargs)添加子图说明、参数、返回值Add an Axes to the figure as part of a subplot arrangement.作为子图布置的一部分,将坐标轴添加到图中。Call signatures:如何调用:add_subplot(nrows, ncols, index, **kwargs)add_subplot(pos, **kwargs)add_subplot(ax).转载 2020-10-16 18:15:15 · 8786 阅读 · 0 评论 -
python输入输出到文件中的操作
链接:python的文件操作原创 2020-10-15 11:07:14 · 224 阅读 · 0 评论 -
pytorch初学者的函数收集手册。(一)
这些函数都在pytorch的中文手册中有,但是我把我用到的会记录下来。1.torch.mm()torch.mm(mat1, mat2, out=None) → Tensor#按照矩阵的乘法相乘;例如a是mXn的,bshi nXc的那么得到的就是mXc的一个矩阵“”“>>> mat1 = torch.randn(2, 3)>>> mat2 = torch.randn(3, 3)>>> torch.mm(mat1, mat2) 0原创 2020-09-18 14:54:44 · 894 阅读 · 0 评论 -
iterable和iterator
(转载:http://blog.csdn.net/passionkk/article/details/49929887)Python中 list,truple,str,dict这些都可以被迭代,但他们并不是迭代器。为什么?因为和迭代器相比有一个很大的不同,list/truple/map/dict这些数据的大小是确定的,也就是说有多少事可知的。但迭代器不是,迭代器不知道要执行多少次,所以可以理解为不知道有多少个元素,每调用一次next(),就会往下走一步,是惰性的。判断是不是可以迭代,用It.翻译 2020-09-22 09:51:46 · 92 阅读 · 0 评论 -
plt输出图片
import matplotlib.pyplot as pltplt.savefig原创 2020-09-21 21:24:14 · 1496 阅读 · 0 评论 -
numpy库中的矩阵操作和transpose()函数
矩阵操作:https://blog.csdn.net/weixin_43216017/article/details/87380214 注意:*是点乘。 a.numpy.transpose():https://blog.csdn.net/u012762410/article/details/78912667 https://blog.csdn.net/weixin_4830662...原创 2020-09-21 21:12:17 · 301 阅读 · 0 评论 -
python的np.random.rand()
1.简单随机数据 rand(d0,d1,...,dn) 随机值 >>> np.random.rand(3,2)array([[ 0.14022471, 0.96360618], #random [ 0.37601032, 0.25528411], #random [ 0.49313049, 0.94909878]]) #random randn(d0,d1,...,dn) ...转载 2020-09-21 16:32:03 · 5098 阅读 · 0 评论 -
import module与from .. import module的区别
区别1import module 引用共享变量时,要使用module.变量名。而from module import * 直接使用变量名即可区别2(有点绕)import module方式操作module的变量时,本地不会创建新变量,操作的是目标模块的变量!from module import *方式操作module变量时,实质上是在本地创建一个与目标模块相同的变量名,并且默认与目标模块变量指向同一个内存空间。第二点是关于内存分配的,在写代码的时候应该注意就好。...转载 2020-09-21 16:18:32 · 441 阅读 · 0 评论 -
python用到的函数的总结(主要是学习pytorch过程中用到的一些,希望会帮助到别人)
1. golb();文件名模式匹配,支持通配符操作主要的通配符有:* ? [ ]#使用*作为通配符,匹配所有import globfor name in glob.glob('*'): print("the name:", name)#结果the name: second.txtthe name: first.txtthe name: test.py#使用?作为通配符import globfor name in glob.glob('first.t?t.原创 2020-09-21 15:57:24 · 172 阅读 · 0 评论 -
python中的格式化输出和其它的输出方式
>>> s 'Hello' >>> x = len(s) >>> print("The length of %s is %5d" % (s,x)) The length of Hello is 5 更加详细的内容请参考@若夫萤雨霏霏的博客。原创 2020-09-20 13:37:45 · 86 阅读 · 0 评论