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

东莞网站制作个性化/爱链接外链购买

东莞网站制作个性化,爱链接外链购买,政府网站英文域名注册,西安本地十家做网站建设的公司将 PyTorch Model 用可视化方法浏览 torchview文档代码图像示例特点 onnx, netron导出 model 的 onnx 文件示例特点 torchinfo summary图片示例特点 nn-svg使用开源项目特点 使用 PyTorch 构建的 Model,想要查看网络的图形,那么有以下方法,最…

将 PyTorch Model 用可视化方法浏览

    • torchview
      • 文档
      • 代码
      • 图像示例
      • 特点
    • onnx, netron
      • 导出 model 的 onnx 文件
      • 示例
      • 特点
    • torchinfo summary
      • 图片示例
      • 特点
    • nn-svg
      • 使用
      • 开源项目
      • 特点

使用 PyTorch 构建的 Model,想要查看网络的图形,那么有以下方法,最终可视化效果最好的是:torchview; 对于优秀论文中的神经网络图则主要是通过 PPT 等更自由的工具手绘的1

torchview

文档

https://mert-kurttutan.github.io/torchview/tutorial/example_introduction/

需要安装:

  • graphviz, 并保证 dot.exe 在 PATH 路径
  • torchview

代码

def export_model_graph(model, input_sample, directory, filename = "model_graph", format = "svg", scale=5.0):'''Export model as image with torchviewhttps://mert-kurttutan.github.io/torchview/reference/torchview/#torchview.torchview.draw_graph'''model_graph = draw_graph(model, input_size=input_sample.shape, expand_nested=True, directory=directory)model_graph.visual_graph.node_attr["fontname"] = "Helvetica"model_graph.resize_graph(scale=scale) # scale as per the view# https://graphviz.readthedocs.io/en/stable/api.html#graphviz.Graphmodel_graph.visual_graph.render(filename=filename, directory=directory, format=format)filepath = os.path.join(directory, "%s.%s" % (filename, format))if not os.path.exists(filepath):raise BaseException("Error on export torchview graph %s" % filepath)return filepath

图像示例

在这里插入图片描述

特点

清晰直观,信息丰富。

onnx, netron

https://onnx.ai/
https://github.com/lutzroeder/netron/tree/

导出 model 的 onnx 文件

def export_onnx_archive(model, filepath, input_sample):'''Export model as onnx format filehttps://pytorch.org/docs/stable/onnx.html'''is_training = Falseif model.training:# view the network graph in onnx format# https://pytorch.org/docs/stable/onnx.htmlmodel.eval()is_training = Truetorch.onnx.export(model,        # model to export(input_sample,),      # inputs of the model,filepath,        # filename of the ONNX modelinput_names=["input"],  # Rename inputs for the ONNX modeldynamo=True             # True or False to select the exporter to use)if not os.path.exists(filepath):raise BaseException("File %s not found" % filepath)if is_training:model.train()

示例

在这里插入图片描述

特点

识别更多模型的信息。

缺点:

  • 需要额外导出 onnx model
  • 并没有 torchview 直观

torchinfo summary

from torchinfo import summary
logger.info(summary(resnet_model_50, verbose=0))

图片示例

在这里插入图片描述

特点

是文本的形式,简洁依赖少。

缺点:

  • 表现力不如 torchview

nn-svg

生成 FCNN,AlexNet, LeNet 论文中,手绘风格的神经网络图片。可以手动设置参数。

使用

https://www.chatopera.com/files/nn-graph/index.html
在这里插入图片描述

开源项目

https://github.com/alexlenail/NN-SVG

特点

  • 生成和论文中类似的风格的图片

  1. https://datascience.stackexchange.com/questions/66343/drawing-neural-network-diagram-for-academic-papers ↩︎

http://www.whsansanxincailiao.cn/news/32032884.html

相关文章:

  • 成都哪家网站建设/如何做好网络推广销售
  • 深圳设计网站开发/重庆网站排名
  • 音乐网站怎么建设/东莞网站推广及优化
  • 国外英文网站/最新新闻
  • 副业做网站程序/网页制作素材模板
  • 服装网页设计网站/软文代写是什么
  • 专做茶叶的网站/北京建设网站公司
  • 网站建设和平面设计/国内seo公司排名
  • 创做阿里巴巴网站流程/今日最新国际新闻
  • 深圳手机网站建设多少钱/网络广告公司
  • wap网站建设/怎么优化自己网站
  • 沂南网站建设/百度指数有哪些功能
  • 做移动网站优化快速排名软件/免费软文推广平台都有哪些
  • 学校网站欣赏中文/技术培训平台
  • 连锁酒店网站建设公司/百度提交入口地址在哪
  • 平面艺术设计/seo整站优化推广
  • 公司网站放哪些内容/日本域名注册
  • 12306网站为什么做不好/武汉seo论坛
  • 教育网站建设/百度权重等级
  • 西部数码网站助手/云南网络推广服务
  • 两个网站互相做外链/苏州网站制作
  • 做自己任务的网站/网店无货源怎么做
  • 网站导航栏三根横线怎么做的/百度统计代码安装位置
  • xxx网站建设与优化推广/百度客户端在哪里打开
  • 初级买题做哪个网站好/百度员工收入工资表
  • flashxml网站模板/近期热点新闻事件
  • 营销型网站建设空间必须是/品牌线上推广方式
  • 微信网站建设热线/武汉网站seo推广
  • 怎么建立自己网站 asp/泉州百度首页优化
  • 公司网站建设要注意的问题/百度官方营销推广平台加载中