博客
关于我
ShuffleNetV2(torch.jit.ScriptModule)
阅读量:107 次
发布时间:2019-02-26

本文共 1731 字,大约阅读时间需要 5 分钟。

 

        #coding=utf-8        from collections import OrderedDict        import torch        import torch.nn as nn        import torch.nn.functional as F        from torch.nn import init        import timedef _make_divisible(v, divisor, min_value=None):            """This function is taken from the original tf repo.            It ensures that all layers have a channel number that is divisible by 8            It can be seen here: https://github.com/tensorflow/models/blob/master/research/slim/nets/mobilenet/mobilenet.py            :param v:            :param divisor:            :param min_value: (optional)            :return:            """            if min_value is None:                min_value = divisor            new_v = max(min_value, int(v + divisor / 2.0) // divisor * divisor)            # Make sure that round down does not go down by more than 10%.            if new_v < 0.9 * v:                new_v += divisor            return new_v        class SELayer(nn.Module):            def __init__(self, channel, reduction=16):                # ??????                super(SELayer, self).__init__()                # ?????????                self.channel = channel                # ????????                self.reduction = reduction            def forward(self, x):                # ??????                # ??x                # ... (??????)                # ????????                return x            def __repr__(self):                # __repr__??                return f"SELayer({self.channel}d, reduction={self.reduction})"        

????????????????????

  • ????????????
  • ?????????
  • ???????????
  • ??????????
  • ???"first?second"????
  • ?????????????
  • ???????????
  • ??????????????
  • ???????????????????????????????

    转载地址:http://vrtk.baihongyu.com/

    你可能感兴趣的文章
    mysql 数据库中 count(*),count(1),count(列名)区别和效率问题
    查看>>
    mysql 数据库备份及ibdata1的瘦身
    查看>>
    MySQL 数据库备份种类以及常用备份工具汇总
    查看>>
    mysql 数据库存储引擎怎么选择?快来看看性能测试吧
    查看>>
    MySQL 数据库操作指南:学习如何使用 Python 进行增删改查操作
    查看>>
    MySQL 数据库的高可用性分析
    查看>>
    MySQL 数据库设计总结
    查看>>
    Mysql 数据库重置ID排序
    查看>>
    Mysql 数据类型一日期
    查看>>
    MySQL 数据类型和属性
    查看>>
    mysql 敲错命令 想取消怎么办?
    查看>>
    Mysql 整形列的字节与存储范围
    查看>>
    mysql 断电数据损坏,无法启动
    查看>>
    MySQL 日期时间类型的选择
    查看>>
    Mysql 时间操作(当天,昨天,7天,30天,半年,全年,季度)
    查看>>
    MySQL 是如何加锁的?
    查看>>
    MySQL 是怎样运行的 - InnoDB数据页结构
    查看>>
    mysql 更新子表_mysql 在update中实现子查询的方式
    查看>>
    MySQL 有什么优点?
    查看>>
    mysql 权限整理记录
    查看>>