自定义博客皮肤VIP专享

*博客头图:

格式为PNG、JPG,宽度*高度大于1920*100像素,不超过2MB,主视觉建议放在右侧,请参照线上博客头图

请上传大于1920*100像素的图片!

博客底图:

图片格式为PNG、JPG,不超过1MB,可上下左右平铺至整个背景

栏目图:

图片格式为PNG、JPG,图片宽度*高度为300*38像素,不超过0.5MB

主标题颜色:

RGB颜色,例如:#AFAFAF

Hover:

RGB颜色,例如:#AFAFAF

副标题颜色:

RGB颜色,例如:#AFAFAF

自定义博客皮肤

-+
  • 博客(16)
  • 收藏
  • 关注

原创 Anaconda离线安装OpenCV

Anaconda离线快速安装Opencv库

2024-04-02 15:38:56 411 1

原创 使用selenium库,出现“ValueError: Timeout value...”问题时可尝试的解决方法

错误,可能原因是虚拟环境中。运行以上代码时,出现【

2024-01-29 12:08:49 509

原创 Anaconda常用命令总结

4 指定镜像的情况下安装指定库。

2024-01-29 11:57:50 223

原创 期刊投稿时编译错误

Latex编译错误

2023-10-23 18:32:31 314

原创 将数据写成JSON格式,indent使用

将数据写成Json格式,参数indent使用

2022-06-16 16:23:14 779 1

原创 Word内嵌MathType出现“安全警告问题“

Word内嵌MathType出现安全警告问题

2022-06-07 20:59:22 624

原创 pytorch中gather()方法

1 代码示例:import torcha = torch.arange(15).view(3, 5)b = torch.zeros_like(a)b[1][2] = 1b[0][0] = 2a、b矩阵分别为:a矩阵tensor([[ 0, 1, 2, 3, 4], [ 5, 6, 7, 8, 9], [10, 11, 12, 13, 14]])b矩阵tensor([[2, 0, 0, 0, 0], [0, 0, 1, 0

2022-04-02 17:25:52 1721 1

原创 将二维列表写入txt文件, 以及读取

1 将二维列表写入txt文件my_list = [[1, 2 ,3], [4, 5, 6]]with open('my_list.txt', 'w') as f1: for i in range(len(my_list)): for j in range(len(my_list[i])): f1.write(str(my_list[i][j])) if(j != (len(my_list[i])-1)):

2022-04-02 10:53:38 826

原创 【Pytroch】中view、randint、requires_grad和detach方法、Embedding、RMSE和MAE

1 view方法import torcha = torch.Tensor([[[1,2,3], [4,5,6]]])b = torch.Tensor([1,2,3,4,5,6])print(a.view(-1))print(b.view(-1))————结果:tensor([1., 2., 3., 4., 5., 6.])tensor([1., 2., 3., 4., 5., 6.])2 randint方法a = torch.randint(

2022-03-12 16:35:04 1965

原创 numpy、pandas、Counter、结巴

1 处理数据a = ['1 23', '12 28', '25 35', '27 80', '36 50']for i in range(len(a)): temp = a[i].split(' ') temp = list(map(int, temp)) turple = (temp[0], temp[1]) a[i] = turpleprint(a)————结果:[(1, 23), (12, 28), (25, 35), (27, 80), (36, 50)

2022-03-12 16:09:24 1245

原创 torch.RNN使用

inputs = torch.randn(3, 4, 16)rnn = torch.nn.RNN(input_size=16, hidden_size=6, num_layers=20)h0 = torch.randn(20, 4, 6)outputs, _ = rnn(inputs, h0)print(outputs)

2022-02-04 23:56:26 1652

原创 xftp无法连接到远程服务器

xftp无法连接远程服务器

2022-01-28 22:14:26 11174 2

原创 Python读入Excel的xlsx文件 corr相关系数 对向量和矩阵进行softmax

Python读入Excel的xlsx文件 corr相关系数 对向量和矩阵进行softmax方法1:利用pandas方法2:利用xlrd#-------方法一-------:import pandas as pd#其中filePath是读入xlsx文件的路径filePath = "C:/Users/MD.xlsx"data = pd.read_excel(filePath)#得到的data是DateFrame类型,可利用pandas进行变换#-------方法二-------:i

2021-10-15 21:44:39 315

原创 Python 二维数组使用lexsort(排序)

使用场景:对指定行或列排序先对某列排序;若有相等值,再根据相等值所在行(或列)排序;若还有想等值,一直往前递推下面为几组数据介绍,可以理理思路"""1. 对指定行排序时 相同行中有相同的数时,参照相同数的上一行的大小2. 若还相等,继续递进"""#arr2为自己设计的数据arr2 = np.array([[1, 2, 1, 3], [4, 3, 3, 1], [4, 5, 6...

2020-03-27 23:25:34 2395 2

原创 jupyter notebook实现浏览器自动跳转

本人参考网上的方法,出现以下的问题:修改jupyter_notebook_config.py配置文件后则成功实现跳转:代码如下:import webbrowser webbrowser.register('chrome',None,webbrowser.GenericBrowser(r'C:\Users\哈哈\AppData\Local\Google\Chrome\Application\c...

2020-03-04 22:29:52 738

原创 c++ assign()、find()、replace()、swap()、cin.ignore()函数

c++ assign()、find()、replace()、swap()、cin.ignore()函数str.assign()参数用法:String str = “123456”;str1.assign(str);//复制整个strstr2.assign(“abcdefg”, 4);//从acdefg截取前4个字符串str3.assign(str, 2, 4)//从str下标为2的字符...

2020-02-01 12:30:12 281

空空如也

空空如也

TA创建的收藏夹 TA关注的收藏夹

TA关注的人

提示
确定要删除当前文章?
取消 删除