2020年7月21日
摘要: a = tf.constant([1,5],dtype=tf.int64) b = np.arange(0,5) c = tf.convert_to_tensor(b) d = tf.ones([3,4]) e = tf.random.normal([3,3]) f = tf.random.trun 阅读全文
posted @ 2020-07-21 16:30 知否知否, 阅读(120) 评论(0) 推荐(0) 编辑
  2020年7月17日
摘要: 1可迭代协议:含有__iter__()方法就可迭代,只要可迭代就可以for循环 除了list,dict,str,set,tuple,range(),enumerate,file等都是 2迭代器协议:含有__iter__()和__next__()的就是迭代器。 isinstance([],Iterab 阅读全文
posted @ 2020-07-17 08:37 知否知否, 阅读(98) 评论(0) 推荐(0) 编辑
  2020年7月12日
摘要: def test(a, *args, **kwargs): print a print args print kwargs if __name__ == "__main__": test(1, 2, 3 , d='4', e=5) # 输出 1 (2, 3) {'e': 5, 'd': '4'} 阅读全文
posted @ 2020-07-12 21:03 知否知否, 阅读(106) 评论(0) 推荐(0) 编辑
  2020年7月11日
摘要: 1特征归一化 线性函数归一化:映射到(0,1) 零均值归一化:均值为0,标准差为1 优点:训练数据归一化后,容易更快地通过梯度下降找 到最优解。 当然,数据归一化并不是万能的。在实际应用中,通过梯度下降法求解的模 型通常是需要归一化的,包括线性回归、逻辑回归、支持向量机、神经网络等模 型。但对于决策 阅读全文
posted @ 2020-07-11 14:54 知否知否, 阅读(102) 评论(0) 推荐(0) 编辑
  2020年7月7日
摘要: https://www.cnblogs.com/liwenzhou/p/7988087.html 文档结构 <!DOCTYPE html> <html lang="zh-CN"> <head> <meta charset="UTF-8"> <title>css样式优先级</title> </head 阅读全文
posted @ 2020-07-07 13:28 知否知否, 阅读(106) 评论(0) 推荐(0) 编辑
摘要: TCP传输特点 面向连接的传输服务: 1传输特征:提供了可靠的传输,可靠性指数据传输过程中无丢失,无失序,无差错,无重复 2可靠性保障机制: 1在通信前需要建立数据连接 2确认应答机制 3通信结束要正常断开连接 三次握手(建立连接) 四次挥手(断开连接) 阅读全文
posted @ 2020-07-07 12:12 知否知否, 阅读(100) 评论(0) 推荐(0) 编辑
摘要: 服务端 from socket import * import pymysql class Database: def __init__(self): self.db = pymysql.connect(host='localhost', port=3306, user='root', passwo 阅读全文
posted @ 2020-07-07 10:47 知否知否, 阅读(121) 评论(0) 推荐(0) 编辑
摘要: 服务端 from socket import * import pymysql class Database: def __init__(self): self.db = pymysql.connect(host="localhost", port=3306, user="root", passwo 阅读全文
posted @ 2020-07-07 09:33 知否知否, 阅读(101) 评论(0) 推荐(0) 编辑
  2020年7月6日
摘要: 1使用流程 1建立数据库连接(db=pymysql.connect(...)) 2创建游标对象(cur=db.cursor()) 3游标方法:cur.execute("insert...") 4提交到数据库或者获取数据:db.commit()/db.fetchall() 5关闭游标对象:cur.cl 阅读全文
posted @ 2020-07-06 18:50 知否知否, 阅读(182) 评论(0) 推荐(0) 编辑
摘要: 1创建索引 #create index 索引名 on 表名(列名) create index name_index on index_test(name); 2删除索引 #drop index 索引名 on 表名 drop index name_index on index_test; 3查看语句执 阅读全文
posted @ 2020-07-06 16:58 知否知否, 阅读(162) 评论(0) 推荐(0) 编辑