摘要: github参考:https://github.com/wangjiwu/BERT-sentiment--classification 一、准备数据 bert官方与训练数据下载 自己的数据集,(训练集,测试集,开发集)(ps:dev.tsv开发集是啥?理解) 二、修改run_classify.py 阅读全文
posted @ 2020-11-26 21:34 qiezi_online 阅读(157) 评论(0) 推荐(0) 编辑
摘要: import numpy as np import matplotlib.pyplot as plt #创建自变量数bai组du x= np.linspace(0,2*np.pi,500) #创建函数值数组 y1 = np.sin(x) y2 = np.cos(x) y3 = np.sin(x*x) 阅读全文
posted @ 2020-11-26 11:59 qiezi_online 阅读(1531) 评论(0) 推荐(0) 编辑
摘要: for i in range(10000): print(i, end = "\r") print(end="\r") 滚动输出到屏幕 阅读全文
posted @ 2020-11-26 09:48 qiezi_online 阅读(387) 评论(0) 推荐(0) 编辑
摘要: 第一种: pd.DataFrame to_csv tmp = pd.DataFrame({"id":[str(i) for i in range(len(test_x))],f"{name}":outputs}) print("save csv ...") tmp.to_csv(os.path.jo 阅读全文
posted @ 2020-11-25 18:58 qiezi_online 阅读(916) 评论(0) 推荐(0) 编辑
摘要: 一、BCELoss 二分类损失函数 输入维度为(n, ), 输出维度为(n, ) 如果说要预测二分类值为1的概率,则建议用该函数! 输入比如是3维,则每一个应该是在0——1区间内(随意通常配合sigmoid函数使用),举例如下: import torchimport torch.nn as nnm 阅读全文
posted @ 2020-11-25 17:27 qiezi_online 阅读(4361) 评论(0) 推荐(0) 编辑
摘要: 阅读全文
posted @ 2020-11-25 12:02 qiezi_online 阅读(88) 评论(0) 推荐(0) 编辑
摘要: 代码和ppt: https://github.com/Iallen520/lhy_DL_Hw 遇到的一些细节问题: 1. X_train文件不带后缀名csv,所以不是规范的csv文件,不能直接用pd.read_csv,否则发现第一行名有错误,所以用原始的方法去处理 2. 记着拆分train和test 阅读全文
posted @ 2020-11-21 12:10 qiezi_online 阅读(242) 评论(0) 推荐(0) 编辑
摘要: 任务描述:利用前9小时数据,预测第10小时的pm2.5的数值,回归任务 kaggle地址:https://www.kaggle.com/c/ml2020spring-hw1 训练集为: 12个月*20天*18维(共4320行) , 24小时(列) 每月的前20天 test为: 18*240行, 9 阅读全文
posted @ 2020-11-12 11:31 qiezi_online 阅读(459) 评论(0) 推荐(0) 编辑
摘要: import csv sumbmit_csv_path = "submit_have_valid_SGD.csv" with open(sumbmit_csv_path, "w") as f: csv_writer = csv.writer(f) header = ['id', 'value'] p 阅读全文
posted @ 2020-11-12 10:31 qiezi_online 阅读(153) 评论(0) 推荐(0) 编辑
摘要: %matplotlib inline import matplotlib.pyplot as plt plt.plot(xx,yy_train_loss,"r", label = "train_loss") plt.plot(xx,yy_valid_loss,"b", label = "valid_ 阅读全文
posted @ 2020-11-12 10:19 qiezi_online 阅读(81) 评论(0) 推荐(0) 编辑