【Github】 ANN Visualizer -- 用于可视化神经网络的 Python 库
(给机器学习算法与Python学习加星标,提升AI技能)
ANN Visualizer 是一个很不错的 Python 库,兼容 Keras,它使用 Python 的 graphviz 库来创建开发人员正在构建的神经网络的可视化图形。
Github:
https://github.com/Prodicode/ann-visualizer
安装
From Github
- 从 Github 上下载 ann_visualizer 文件夹。
- 将 ann_visualizer 文件夹放在与主Python脚本相同的目录中。
From pip
使用以下命令:
pip install ann_visualizer
用法
from
#Build your model here
ann_visualizer.visualize
import ann_viz;
#Build your model here
ann_viz(model)
文件
ann_viz(model, view=True, filename="network.gv", title="MyNeural Network")
- model - Keras Sequential 模型
- view - 如果为 True,则在执行后打开图预览
- filename - 保存图形的位置。(.gv 文件格式)
- title - 图形的标题
示例
import
from
from
#Hidden Layer#1
#Hidden Layer#2
#Exit Layer
from
keras;
from
keras.models
import Sequential;
from
keras.layers
import Dense;
network = Sequential();
#Hidden Layer#1
network.add(Dense(units=
6,
activation=
relu ,
kernel_initializer=
uniform ,
input_dim=
11));
#Hidden Layer#2
network.add(Dense(units=
6,
activation=
relu ,
kernel_initializer=
uniform ));
#Exit Layer
network.add(Dense(units=
1,
activation=
sigmoid ,
kernel_initializer=
uniform ));
from
ann_visualizer.visualize
import ann_viz;
ann_viz(network, title=
"");
输出结果:
关键词
模型
神经网络
文件夹
命令
最新评论
推荐文章
作者最新文章
你可能感兴趣的文章
Copyright Disclaimer: The copyright of contents (including texts, images, videos and audios) posted above belong to the User who shared or the third-party website which the User shared from. If you found your copyright have been infringed, please send a DMCA takedown notice to [email protected]. For more detail of the source, please click on the button "Read Original Post" below. For other communications, please send to [email protected].
版权声明:以上内容为用户推荐收藏至CareerEngine平台,其内容(含文字、图片、视频、音频等)及知识版权均属用户或用户转发自的第三方网站,如涉嫌侵权,请通知[email protected]进行信息删除。如需查看信息来源,请点击“查看原文”。如需洽谈其它事宜,请联系[email protected]。
版权声明:以上内容为用户推荐收藏至CareerEngine平台,其内容(含文字、图片、视频、音频等)及知识版权均属用户或用户转发自的第三方网站,如涉嫌侵权,请通知[email protected]进行信息删除。如需查看信息来源,请点击“查看原文”。如需洽谈其它事宜,请联系[email protected]。