会员
众包
新闻
博问
闪存
赞助商
HarmonyOS
Chat2DB
所有博客
当前博客
我的博客
我的园子
账号设置
会员中心
简洁模式
...
退出登录
注册
登录
xzh-personal-issue
博客园
首页
新随笔
联系
订阅
管理
上一页
1
···
3
4
5
6
7
8
9
10
11
···
14
下一页
2023年10月12日
pytorch中tensor剪切行或列
摘要: 使用示例 x = x[:,:,torch.arange(x.size(2))%8!=0] 剪切掉第三个维度的8的整数行 维度上不仅支持用:进行多行选择,也可以用bool组成的tensor判断是否保存这一行。
阅读全文
posted @ 2023-10-12 21:13 心比天高xzh
阅读(55)
评论(0)
推荐(0)
2023年10月10日
pytorch报错
摘要: 问题报错 RuntimeError: one of the variables needed for gradient computation has been modified by an inplace operation: [torch.FloatTensor [544, 768]], whi
阅读全文
posted @ 2023-10-10 15:19 心比天高xzh
阅读(73)
评论(0)
推荐(0)
2023年10月8日
pytorch训练模版
摘要: train.py import torch import numpy as np import os import math import sys import argparse import psutil import torch import torch.optim as optim impor
阅读全文
posted @ 2023-10-08 15:27 心比天高xzh
阅读(80)
评论(0)
推荐(0)
python命令行传参
摘要: #run.py import argparse parser = argparse.ArgumentParser() parser.add_argument('--device', type=str, default='cpu:0',help='use which device') parser.a
阅读全文
posted @ 2023-10-08 14:50 心比天高xzh
阅读(26)
评论(0)
推荐(0)
pytorch 自定义dataset类
摘要: 实现模版 class our_dataset(Dataset): def __init__(self,···): super(our_dataset, self).__init__() #初始化,可以自定义添加参数 def __getitem__(self,index): ··· return im
阅读全文
posted @ 2023-10-08 14:29 心比天高xzh
阅读(36)
评论(0)
推荐(0)
python查看占用系统内存
摘要: import os import psutil info = psutil.virtual_memory() print(u'cpu个数:',psutil.cpu_count()) print(u'电脑总内存:%.4f GB' % (info.total / 1024 / 1024 / 1024))
阅读全文
posted @ 2023-10-08 14:22 心比天高xzh
阅读(41)
评论(0)
推荐(0)
2023年9月5日
pytorch优化器
摘要: #torch.optim.SGD 常用参数列表: params 需要学习的参数 lr 学习率 momentum:冲量 加入冲量后权重更新公式由v=−dx∗lr+v变成v=−dx∗lr+v∗momemtum weight_decay:权重衰减 防止过拟合,原理见[这里](https://zhuanla
阅读全文
posted @ 2023-09-05 08:40 心比天高xzh
阅读(53)
评论(0)
推荐(0)
2023年7月3日
微信没法正常打开
摘要: 原因未知,解决方法:删除C:\Users\123\AppData\Roaming\Tencent\WeChat文件夹下所有内容,再打开应用。
阅读全文
posted @ 2023-07-03 22:02 心比天高xzh
阅读(75)
评论(0)
推荐(0)
2023年5月12日
uart RS232通信
摘要: 波特率指的是异步时钟的频率。 source code top module `timescale 1ns / 1ps ////////////////////////////////////////////////////////////////////////////////// // Compa
阅读全文
posted @ 2023-05-12 10:42 心比天高xzh
阅读(21)
评论(0)
推荐(0)
lcd屏幕实验
摘要: 显示原理与VGA原理类似。 使用屏幕为800*480分辨率,对应的时序参数如下: 行显示时序如下图: 列显示时序与行显示时序类似。 #source code `timescale 1ns / 1ps //////////////////////////////////////////////////
阅读全文
posted @ 2023-05-12 10:19 心比天高xzh
阅读(126)
评论(0)
推荐(0)
上一页
1
···
3
4
5
6
7
8
9
10
11
···
14
下一页
公告