admin管理员组文章数量:1565350
ChatGPT简介
ChatGPT&DALLE2是OpenAI的最新研究成果,在量子位看到他的强大功能后,就自己试玩了一下,比如我让ChatGPT帮我写一个GraphSage模型,ChatGPT先简单解释了一下GraphSage,然后写出了不错的PyTorch代码 (详见见示例一),是不是很神奇?
ChatGPT&DALLE2试用攻略
在我将量子位的公众号文章转发朋友圈之后,很多人遇到了怎么注册的问题,China是不允许注册的,注册过程需要手机号,一种简单的方式是找国外的同学/朋友借,另一种是直接淘宝买,只有几块钱。直接登陆,在下图输入框输入你想让他做的事,点击右侧小三角(DALLE2是Generate按钮)即可。
示例一 写代码
写东西需要用ChatGPT,网址ChatGPT
import torch
import torch.nn as nn
class GraphSAGE(nn.Module):
def __init__(self, input_dim, hidden_dim, output_dim, num_samples):
super(GraphSAGE, self).__init__()
self.input_dim = input_dim
self.hidden_dim = hidden_dim
self.output_dim = output_dim
self.num_samples = num_samples
self.embedding = nn.Embedding(input_dim, hidden_dim)
self.aggregator = nn.Linear(hidden_dim * num_samples, hidden_dim)
self.classifier = nn.Linear(hidden_dim, output_dim)
def forward(self, nodes, neighbors):
# Extract node embeddings
node_embeddings = self.embedding(nodes)
# Sample and aggregate neighbor embeddings
neighbor_embeddings = [self.embedding(neighbors[:, i])
for i in range(self.num_samples)]
neighbor_embeddings = torch.cat(neighbor_embeddings, dim=1)
aggregated_neighbors = self.aggregator(neighbor_embeddings)
# Combine node and aggregated neighbor embeddings
combined = torch.cat([node_embeddings, aggregated_neighbors], dim=1)
# Predict node labels
return self.classifier(combined)
示例二 写诗
示例三 画画
画画需要用DALLE2,网址DALL·E
版权声明:本文标题:AI写代码修Bug画画写诗,ChatGPT&DALLE2试用攻略 内容由热心网友自发贡献,该文观点仅代表作者本人, 转载请联系作者并注明出处:https://www.elefans.com/dongtai/1726698185a1081312.html, 本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌抄袭侵权/违法违规的内容,一经查实,本站将立刻删除。
发表评论