随笔分类 -  模型压缩和加速

实现简单的straight-through estimator(STE)(pytorch版)
摘要:import torch input = torch.randn(4,requires_grad = True) output = torch.sign(input) loss = output.mean() loss.backward() print(input) print(input.grad 阅读全文

posted @ 2020-09-09 17:35 cltt 阅读(1386) 评论(0) 推荐(0) 编辑

计算模型的Para和GFLOPs
摘要:import torch.nn as nn import torch import torch.nn.functional as F class FP_Conv2d(nn.Module): def __init__(self, input_channels, output_channels, ker 阅读全文

posted @ 2020-08-28 15:49 cltt 阅读(879) 评论(0) 推荐(0) 编辑

< 2025年3月 >
23 24 25 26 27 28 1
2 3 4 5 6 7 8
9 10 11 12 13 14 15
16 17 18 19 20 21 22
23 24 25 26 27 28 29
30 31 1 2 3 4 5

导航

统计

点击右上角即可分享
微信分享提示