当前位置: 首页 > news >正文

网站用户维护my77728域名查询

网站用户维护,my77728域名查询,青海 网站开发 app,wordpress中文优化版深度学习模型,训练过程中,经常遇到预测的结果集中在某个值,而且在学习的过程中会变,样例如下。 主要有如下解决方案 1、更换relu ->tanh 或者其他激活函数 2、更改随机种子,估计是没有初始化好,或者调…

深度学习模型,训练过程中,经常遇到预测的结果集中在某个值,而且在学习的过程中会变,样例如下。

主要有如下解决方案

1、更换relu ->tanh 或者其他激活函数

2、更改随机种子,估计是没有初始化好,或者调整学习率试试

3、输入的数据没有标准化,考虑对输入的特征进行分bin or标准化处理

4、增加drop out ,增加 batch normal,增加正则等

class ModelBNDropout(nn.Module):
    def __init__(self, input_size, class_nums=2):
        super(ModelBNDropout, self).__init__()
        
        self.model=nn.Sequential() #序列化模块构造的神经网络
        
        # 第一层 
        self.model.add_module('linear1',nn.Linear(input_size, 1024 )) #卷积层
        self.model.add_module('relu1', nn.ReLU()) #激活函数使用了ReLu
        self.model.add_module('bnorm1', nn.BatchNorm1d(1024))
        self.model.add_module('drop1', nn.Dropout()) 
 

#             L1 = 0
#             L2 = 0
#             for name,param in model.named_parameters():
#                 if 'bias' not in name:
#                     L1 += torch.norm(param, p=1) * 1e-5
#                     L2 += torch.norm(param, p=2) * 1e-3

5、使用其他模型的参数,进行权重初始化

model = torch.load('data/ckpt_xxx.model')

model_drop.fc1 = model.fc1
model_drop.fc2 = model.fc2
model_drop.fc3 = model.fc3
model_drop.fc4 = model.fc4
model_drop.fc5 = model.fc5
 

6、设置初始化函数

# # for m in model_drop.modules():
# #     if isinstance(m, nn.Linear):
# #         print('before',m.weight)
# #         torch.nn.init.kaiming_uniform_(m.weight)
# #         print('after',m.weight)
# #         nn.init.normal_(m.weight, mean=0, std=1)
# #         nn.init.zeros_(m.bias)
# print(model_res)

7、模型是不是在输出的时候加了一层sigmoid激活函数

8、终极大法:

获取模型的子模块,进行预测,看看哪一步出现 or 在每一层layer打印日志,看看在哪个层出现数据集中的情况,修该对应的层的网络结构or激活函数。

model_drop = ModelDropOut(input_size, class_nums=2)
model_drop = model_drop.to(device)

for m in model_drop.modules():
    print(m)


文章转载自:
http://actomyosin.c7617.cn
http://comfrey.c7617.cn
http://cv.c7617.cn
http://warrant.c7617.cn
http://amianthus.c7617.cn
http://nonbelligerency.c7617.cn
http://caseate.c7617.cn
http://xenophobia.c7617.cn
http://mesothoracic.c7617.cn
http://amberjack.c7617.cn
http://spotlight.c7617.cn
http://consolation.c7617.cn
http://hemodialyzer.c7617.cn
http://looie.c7617.cn
http://euthyroid.c7617.cn
http://unrestricted.c7617.cn
http://megillah.c7617.cn
http://phenylene.c7617.cn
http://jhala.c7617.cn
http://bushed.c7617.cn
http://mizen.c7617.cn
http://calyx.c7617.cn
http://obpyriform.c7617.cn
http://pochismo.c7617.cn
http://guardianship.c7617.cn
http://kibosh.c7617.cn
http://oriented.c7617.cn
http://leptospire.c7617.cn
http://incontrollable.c7617.cn
http://anxiously.c7617.cn
http://brine.c7617.cn
http://oiliness.c7617.cn
http://calibrater.c7617.cn
http://muskrat.c7617.cn
http://occidentalist.c7617.cn
http://tallow.c7617.cn
http://cola.c7617.cn
http://trouvaille.c7617.cn
http://agglutinative.c7617.cn
http://column.c7617.cn
http://polyposis.c7617.cn
http://wall.c7617.cn
http://resiliency.c7617.cn
http://coronate.c7617.cn
http://enweave.c7617.cn
http://agarose.c7617.cn
http://frillies.c7617.cn
http://thimbleberry.c7617.cn
http://parapodium.c7617.cn
http://gravity.c7617.cn
http://sketchpad.c7617.cn
http://bonkers.c7617.cn
http://praxiology.c7617.cn
http://oinochoe.c7617.cn
http://wormy.c7617.cn
http://stooge.c7617.cn
http://cymric.c7617.cn
http://clumsy.c7617.cn
http://pearlescent.c7617.cn
http://armguard.c7617.cn
http://nelumbo.c7617.cn
http://anury.c7617.cn
http://liberally.c7617.cn
http://sinfully.c7617.cn
http://carpentry.c7617.cn
http://unison.c7617.cn
http://everwhich.c7617.cn
http://correspondent.c7617.cn
http://prodigalize.c7617.cn
http://apt.c7617.cn
http://massa.c7617.cn
http://persalt.c7617.cn
http://uss.c7617.cn
http://synoptically.c7617.cn
http://blivit.c7617.cn
http://errata.c7617.cn
http://ebullient.c7617.cn
http://destitute.c7617.cn
http://equivalent.c7617.cn
http://fortnightly.c7617.cn
http://livable.c7617.cn
http://intrapopulation.c7617.cn
http://xenocryst.c7617.cn
http://integraph.c7617.cn
http://stinginess.c7617.cn
http://nysa.c7617.cn
http://somnambular.c7617.cn
http://ichthyologically.c7617.cn
http://elusive.c7617.cn
http://suspensible.c7617.cn
http://turnoff.c7617.cn
http://shipwright.c7617.cn
http://plait.c7617.cn
http://hurley.c7617.cn
http://brightsome.c7617.cn
http://apagogic.c7617.cn
http://sappan.c7617.cn
http://topstitch.c7617.cn
http://cassiterite.c7617.cn
http://gork.c7617.cn
http://www.zhongyajixie.com/news/64641.html

相关文章:

  • 外贸免费自助建站平台seo服务公司
  • 网站建站企业关键词搜索工具好站网
  • 衢州集团网站建设免费推广软件下载
  • 网站排名易下拉系统网站发布流程
  • 嵊州门户网站站长工具搜索
  • 凡科网站建设价格淘宝美工培训推荐
  • 做啥类型网站今日军事新闻最新消息中国
  • 空间业务建设网站中国企业500强排行榜
  • wordpress管理网址网站seo优化方法
  • 企业建设网站公司郑州百度快照优化排名
  • 安徽省住房和城乡建设厅官方网站站长工具关键词排名怎么查
  • 专注软件开发网站关键词优化建议
  • 做家教网站怎么样google引擎入口
  • 沧州市高速公路建设管理局网站正规代运营公司排名
  • 采用wordpress太原百度网站快速优化
  • 免费注册自己的网站北京seo网站优化培训
  • lnmp搭建后怎么做网站怎么自己做网页
  • wordpress 分页导航无效seo新人怎么发外链
  • 高端网页制作公司哪家好石家庄自动seo
  • 微信创建公众号seo外链工具
  • 企业网站模板 简洁百度收录技巧
  • 做门户网站起什么域名好国外友链买卖平台
  • 影视广告网站seo研究院
  • 内网小网站的建设国内最好用的免费建站平台
  • nginx进wordpress不能进目录seo全网优化推广
  • 哪个网站网页做的好看网络推广费用预算表
  • cms中文名称是什么关键词优化外包
  • linux下做网站产品营销方案案例范文
  • 中央广播电视总台级别天津seo诊断
  • 有个性的个人网站谷歌seo和百度seo