2018年11月20日

没有免费的午餐定理

摘要: 阅读全文

posted @ 2018-11-20 09:50 那抹阳光1994 阅读(279) 评论(0) 推荐(0)

2018年11月19日

关于机器学习中的i.i.d假设

摘要: 机器学习领域有个很重要的假设:IID独立同分布假设,就是假设训练数据和测试数据是满足相同分布的, 这是通过训练数据获得的模型能够在测试集获得好的效果的一个基本保障。 怎么知道训练数据和测试数据是独立同分布的呢? 训练集训练出了模型,测试集准确性比较低??? 阅读全文

posted @ 2018-11-19 23:04 那抹阳光1994 阅读(4314) 评论(0) 推荐(0)

pytorch中的model.eval()和BN层

摘要: 如果网络模型model中含有BN层,则在预测时应当将模式切换为评估模式,即model.eval()。 评估模拟下BN层的均值和方差应该是整个训练集的均值和方差,即 moving mean/variance。 训练模式下BN层的均值和方差为mini-batch的均值和方差,因此应当特别注意。 阅读全文

posted @ 2018-11-19 15:42 那抹阳光1994 阅读(1933) 评论(0) 推荐(0)

pytorch中的detach和detach_

摘要: pytorch 的 Variable 对象中有两个方法,detach和 detach_ : detach 官方文档中,对这个方法是这么介绍的。 返回一个新的从当前图中分离的 Variable。 返回的 Variable 永远不会需要梯度 如果 被 detach 的Variable volatile= 阅读全文

posted @ 2018-11-19 10:20 那抹阳光1994 阅读(39436) 评论(1) 推荐(3)

2018年11月18日

python中的super()函数

摘要: #!/usr/bin/python # -*- coding: UTF-8 -*- class FooParent(object): def __init__(self): self.parent = 'I\'m the parent.' print ('Parent') def bar(self, 阅读全文

posted @ 2018-11-18 20:43 那抹阳光1994 阅读(325) 评论(0) 推荐(0)

2016年10月3日

matlab求导

摘要: 在matlab中求导要进行符号运算。 >>syms x; >>y = x^cos(x); >>ydot = diff(y, x, 1);%对x求一阶导数 ydot = x^(cos(x) - 1)*cos(x) - x^cos(x)*log(x)*sin(x) >> y2dot = diff(y, 阅读全文

posted @ 2016-10-03 21:36 那抹阳光1994 阅读(1505) 评论(0) 推荐(0)

2016年9月19日

Introduction to the Tcl command language

摘要: tcl是基于字符串的语言。它允许: 1.变量和变量替换 2.数学表达式的求值 3.基本的控制结构(if,while,for,foreach) 4.程序 5.文件操作 incr a等价于a = a+1 每一句的结束可以换行,也可以用分号; tcl基本的语法格式: command $arg1 $arg2 阅读全文

posted @ 2016-09-19 20:59 那抹阳光1994 阅读(320) 评论(0) 推荐(0)

2016年9月18日

Tcl/Tk学习

摘要: 最近确定研究生方向为桥梁抗震,问了下师兄们,他们说课题组里常用的软件为OpenSEES和Abaqus.Abaqus之前有点接触,也做过一些小例子,和python的联系挺紧密的。但是OpenSEES只是听说过,具体也不知道是干什么的,于是就想开始倒腾OpenSEES.一搜索才发现OpenSEES是美国 阅读全文

posted @ 2016-09-18 21:32 那抹阳光1994 阅读(475) 评论(0) 推荐(1)

2016年8月30日

利用char, str2mat, strvcat创建多行字符串数组

摘要: 用专门函数char , str2mat , strvcat创建多行字符串数组示例。 1.char('str1', 'str2',...) Convert to character array (string)转换成字符串数组,空字符串是有效的。 示例:S1=char('This string arr 阅读全文

posted @ 2016-08-30 21:42 那抹阳光1994 阅读(1987) 评论(0) 推荐(0)

2016年8月28日

矩阵操作

摘要: reshape(a, m, n) a是一个含有m*n个元素的数组 如reshape(1:9, 3, 3) findstr(str1, str2) 在str2中查找str1片段 如 b = [0111001000100110111]; a = length(findstr(01, b) 矩阵的翻转 f 阅读全文

posted @ 2016-08-28 18:57 那抹阳光1994 阅读(161) 评论(0) 推荐(0)

导航