上一页 1 ··· 32 33 34 35 36 37 38 39 40 ··· 107 下一页
摘要: 1.概念 当一个函数或类被声明为另一个类的友元时,表示它可以直接访问private私有变量,避免成员函数的频繁调用,提高运行效率,但破坏了封装性。 友元是单向的,不能被继承,且不具有传递性。一个函数可以是多个类的友元函数。 2.例子 转自:https://blog.csdn.net/fanyun_0 阅读全文
posted @ 2021-04-10 17:30 lypbendlf 阅读(126) 评论(0) 推荐(0) 编辑
摘要: 转自:https://blog.csdn.net/u012611878/article/details/79200544 https://my.oschina.net/assange/blog/542896 1.赋值与初始化 初始化为变量分配空间,一般变量是在编译时根据定义初始化;赋值是擦除旧值与写 阅读全文
posted @ 2021-04-10 16:47 lypbendlf 阅读(255) 评论(0) 推荐(0) 编辑
摘要: 1.问题 https://discuss.pytorch.org/t/why-dont-we-put-models-in-train-or-eval-modes-in-dcgan-example/7422 链接中问题当在生成时,如果将generator状态设置为eval(),那么就会模式坍缩,只生成 阅读全文
posted @ 2021-04-09 18:05 lypbendlf 阅读(456) 评论(0) 推荐(0) 编辑
摘要: 1.原理 转自:https://zhuanlan.zhihu.com/p/44169714 https://blog.csdn.net/weixin_30566111/article/details/95351782,这里提到了第四点: 2.推导 W距离用在了什么地方? https://www.cn 阅读全文
posted @ 2021-04-07 16:32 lypbendlf 阅读(163) 评论(0) 推荐(0) 编辑
摘要: 1.torch.utils.data.random_split() pytorch有多种方法划分,但这个是最简单的。 转自:https://www.cnblogs.com/marsggbo/p/10496696.html train_size = int(0.8 * len(full_dataset 阅读全文
posted @ 2021-04-05 04:13 lypbendlf 阅读(4291) 评论(0) 推荐(0) 编辑
摘要: 1.nohup和&的使用 https://www.cnblogs.com/jinxiao-pu/p/9131057.html nohup command > myout.file 2>&1 & 在上面的例子中,0 – stdin (standard input),1 – stdout (standa 阅读全文
posted @ 2021-04-05 02:38 lypbendlf 阅读(63) 评论(0) 推荐(0) 编辑
摘要: 转自:https://blog.csdn.net/liweibin1994/article/details/77374854 1.可迭代对象 当一个类实现了__iter__()和__next__()之后,它就是一个可迭代对象, class test(): def __init__(self,data 阅读全文
posted @ 2021-04-05 00:17 lypbendlf 阅读(61) 评论(0) 推荐(0) 编辑
摘要: 1.写到一个类别下 https://www.pythonheidong.com/blog/article/674750/850e5ee9aa39c1d29ff5/ from torch.utils.tensorboard import SummaryWriter import numpy as np 阅读全文
posted @ 2021-04-04 23:38 lypbendlf 阅读(5214) 评论(0) 推荐(0) 编辑
摘要: 1.作用 运行model.eval()后批归一化层和dropout层就不会在推断时有效果。如果没有做的话,就会产生不连续的推断结果。 2.model.eval()和with torch.no_grad() https://discuss.pytorch.org/t/model-eval-vs-wit 阅读全文
posted @ 2021-04-04 16:29 lypbendlf 阅读(3126) 评论(0) 推荐(0) 编辑
摘要: 转自:https://blog.csdn.net/qq_39938666/article/details/88809726 1.相同点 两者的公式都是这样的。 2.torch.nn.Sigmoid() 它是一个网络层的class类(首字母为大写的),需要先初始化一个网络层,然后forward输入进参 阅读全文
posted @ 2021-04-04 16:19 lypbendlf 阅读(2213) 评论(0) 推荐(0) 编辑
上一页 1 ··· 32 33 34 35 36 37 38 39 40 ··· 107 下一页