当前位置:网站首页>pytorch编程知识(2)
pytorch编程知识(2)
2022-07-01 00:37:00 【Wsyoneself】
- num_worker(指dataloader创建的工作进程数)
- GE2E:Speaker Verification(验证输入的一段语音是否属于一个特定speaker的任务)损失函数,端到端损失函数,收敛速度快、实现简单
torch.gather():从批量tensor中取出指定乱序索引下的数据
array 转为tensor:torch.from_numpy()
二维tensor转置:tensor = torch.transpose(tensor, dim0=0, dim1=1)
pytorch中卷积后保证图像输入输出前后的尺寸大小不变,即实现TensorFlow中“same”的效果:
若卷积核大小为3x3,那么就应该设定padding=1,即填充1层边缘像素;
若卷积核大小为7x7,那么就应该设定padding=3,填充3层边缘像素;
也就是padding大小一般设定为核大小的一半(向下取整)。
调试网络时,查看张量tensor形状shape:
emb.detach().cpu().numpy()
解释:detach():将tensor从计算图中脱离出来,cpu()将放置到cuda上的tensor转换到cpu上(因为只有cpu上的tensor才可以调用numpy),将tensor转为array
边栏推荐
- Shift operators
- How to do the performance pressure test of "Health Code"
- Left join displays the specified value when the left join matching data is null
- What is product thinking
- Wechat official account development (1) introduction to wechat official account
- Length of the longest integrable subarray
- 【2023联发科提前批笔试题】~ 题目及参考答案
- 2022 is half way through. It's hard to make money
- [LeetCode] 爬楼梯【70】
- 给按钮的边框和文字设置不同的背景色
猜你喜欢

Oracle data integrity

Two-stage RO: part 1

20220216 misc buuctf backdoor killing (d shield scanning) - clues in the packet (Base64 to image)

Wechat official account development (1) introduction to wechat official account

20220215 misc buctf easycap Wireshark tracks TCP flow hidden key (use of WinHex tool)

20220216 misc buuctf another world WinHex, ASCII conversion flag zip file extraction and repair if you give me three days of brightness zip to rar, Morse code waveform conversion mysterious tornado br

写给 5000 粉丝的一封信!
![[untitled]](/img/96/7f26614bbdcce71006e38ee34ab216.jpg)
[untitled]

20220215-ctf-misc-buuctf-einstein-binwalk analyze picture-dd command separate zip file -- look for password in picture attribute

C#生成putty格式的ppk文件(支持passphrase)
随机推荐
问题解决:如何管理线程私有(thread_local)的指针变量
Left join displays the specified value when the left join matching data is null
left join左连接匹配数据为NULL时显示指定值
Redis based distributed lock
2022-2028 global encrypted external hard disk industry research and trend analysis report
Set different background colors for the border and text of the button
Unit test concept and purpose
Using asyncio for concurrency
Solving the weird problem that the query conditions affect the value of query fields in MySQL query
NE555 waveform generator handle tutorial NE555 internal structure (I)
None of the following candidates is applicable because of a receiver type mismatch
Luogu p1168 median
[daily record] - bug encountered in BigDecimal division operation
Chapter 53 overall understanding of procedures from the perspective of business logic implementation
leetcode 474. Ones and zeroes (medium)
Integer to hexadecimal string PTA
2022-2028 global retro glass industry research and trend analysis report
C # Generate PPK files in Putty format (passthrough support)
合适的工作就是好工作
Vnctf 2022 cm CM1 re reproduction