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

axure做网站教学视频软件开发培训班

axure做网站教学视频,软件开发培训班,马化腾称视频号是全公司希望,用自己电脑做服务器 网站PyG (PyTorch Geometric) 是建立在 PyTorch 基础上的一个库,用于轻松编写和训练图形神经网络 (GNN),适用于与结构化数据相关的各种应用。官方文档 Install PyG PyG适用于python3.8-3.12 一般使用场景:pip install torch_geometric 或conda …

PyG (PyTorch Geometric) 是建立在 PyTorch 基础上的一个库,用于轻松编写和训练图形神经网络 (GNN),适用于与结构化数据相关的各种应用。官方文档

Install PyG

PyG适用于python3.8-3.12
一般使用场景:pip install torch_geometricconda install pyg -c pyg

Get Started

PyG 具有以下主要功能:

  • Data Handling of Graphs
  • Common Benchmark Datasets
  • Mini-batches
  • Data Transforms
  • Learning Methods on Graphs
  • Exercises

Data Handling of Graphs

PyG 中的单个图由 torch_geometric.data.Data 的一个实例描述,默认情况下该实例拥有以下属性:

  • data.x: Node feature matrix with shape [num_nodes, num_node_features]
  • data.edge_index: Graph connectivity in COO format with shape [2, num_edges] and type torch.long
  • data.edge_attr: Edge feature matrix with shape [num_edges, num_edge_features]
  • data.y: Target to train against (may have arbitrary shape), e.g., node-level targets of shape [num_nodes, *] or graph-level targets of shape [1, *]
  • data.pos: Node position matrix with shape [num_nodes, num_dimensions]

Colab Notebooks and Video Tutorials

官方文档
Pytroch Geometric Tutorials

Tutorials 1

理解一个节点出发的计算图,理解多次计算图后可能节点信息就包含整个图数据信息了,反而没有用。
对应whl地址

安装torch版本对应的pyg,如下所示:

import os
import torch
os.environ['TORCH'] = torch.__version__
print(torch.__version__)!pip install -q torch-scatter -f https://data.pyg.org/whl/torch-${TORCH}.html
!pip install -q torch-sparse -f https://data.pyg.org/whl/torch-${TORCH}.html
!pip install -q git+https://github.com/pyg-team/pytorch_geometric.git

可视化网络的函数实现

# 可视化函数
%matplotlib inline
import torch
import networkx as nx
import matplotlib.pyplot as plt# visualization function for NX graph or Pytorch tensor
def visualize(h, color, epoch=None, loss=None):plt.figure(figsize=(7,7))plt.xticks([])plt.yticks([])if torch.is_tensor(h):# 可视化神经网络运行中间结果h = h.detach().cpu().numpy()plt.scatter(h[:, 0], h[:, 1], s=140, c=color, cmap="Set2")if epoch is not None and loss is not None:plt.xlabel(f'Epoch:{epoch}, Loss:{loss.item():.4f}', fontsize=16)else:nx.draw_networkx(G, pos=nx.spring_layout(G, seed=42), with_labels=False, node_color=color, cmap="Set2")plt.show()

例如:

from torch_geometric.utils import to_networkxG = to_networkx(data, to_undirected=True)
visualize(G, color=data.y)

如图所示:
在这里插入图片描述

参考:

PyTorch Geometric (PyG) 入门教程

http://www.khdw.cn/news/64604.html

相关文章:

  • 网站开发需要提供哪些东西营销培训方案
  • 做网站月入100万市场调查报告模板及范文
  • the7 wordpress 汉化优化大师官方
  • 淄博网站制作设计竞价网
  • 网站建设费摊销几年百度咨询电话人工台
  • 广州建设官方网站企业建网站一般要多少钱
  • 东莞轻推网络科技有限公司搜索引擎优化seo名词解释
  • 武汉论坛东湖社区莆田百度快照优化
  • 接网站建设单子注意事项百度图片识别搜索引擎
  • 网站关键词如何收录营销软文代写
  • 东莞网站建设价格价格快速排名推荐
  • .net网站开发的例子网络营销平台都有哪些
  • 做网站属于什么科目免费平台
  • 做图标的网站杭州seo营销
  • 秦皇岛建设工程信息网站十大seo公司
  • 深圳旅游网站开发一般的电脑培训班要多少钱
  • 佛山建站公司哪家好百度推广效果
  • 优惠券的网站怎么做的品牌营销的四大策略
  • 网站建设收费百度搜索风云榜排行榜
  • 南宁网站设计报价seo排名技术软件
  • 西宁市建设网站公司电话中央电视台新闻联播
  • 高端响应式网站开发磁力猫torrent kitty
  • 怎样给网站做推广长沙网站制作关键词推广
  • 做网页做网站的技术人才免费推广软件 推广帮手
  • 想做一个网站平台怎么做的网站建设推广专家服务
  • 高德地图显示不了台湾上海seo推广服务
  • 做淘客网站太原seo外包服务
  • 微网站怎么做的好名字吗软文撰写公司
  • 大流量网站开发免费的外链网站
  • 密云做网站免费的网站推广方法