AI写代码修Bug画画写诗,ChatGPT&DALLE2试用攻略
2023-06-13 09:15:58 时间
ChatGPT简介
ChatGPT&DALLE2是OpenAI的最新研究成果,在量子位看到他的强大功能后,就自己试玩了一下,比如我让ChatGPT帮我写一个GraphSage模型,ChatGPT先简单解释了一下GraphSage,然后写出了不错的PyTorch代码 (详见见示例一),是不是很神奇?
【最近业余时间都看世界杯了,容我水一篇】
ChatGPT&DALLE2试用攻略
在我将量子位的公众号文章转发朋友圈之后,很多人遇到了怎么注册的问题,China是不允许注册的,注册过程需要手机号,一种简单的方式是找国外的同学/朋友借,另一种是直接淘宝买,只有几块钱。直接登陆,在下图输入框输入你想让他做的事,点击右侧小三角(DALLE2是Generate按钮)即可。
示例一 写代码
写东西需要用ChatGPT,网址https://chat.openai.com/
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,网址https://labs.openai.com/
相关文章
- 测试人员提出的BUG,要追着开发改吗
- 抢了个票,还以为发现了12306的系统BUG
- informatik_bug report
- 线上Bug! Sharing-JDBC第一次查询为什么这么慢?
- 麻了!Spring Boot 从 2.2.5 升级到 2.7.2 之后,一堆BUG
- 那些年,我们一起追的Bug
- 【Vue-Spring跨域Bug已解决】has been blocked by CORS policy: The value of the······
- 记一个SwipeMenuListView侧滑删除错乱的Bug详解手机开发
- 搜狗输入法Linux版发布1.0.0.0021版本,修复影响部分用户的重要Bug
- AMP MySQL升级提升数据库性能的必要之举(amp mysql升级)
- Oracle Bug深度剖析以及解决方案(oracle bug说明)
- iframe的onload在Chrome/Opera中执行两次Bug的解决方法
- JQuery操作Select的Options的Bug(IE8兼容性视图模式)
- EXTjs4.0的store的findRecord的BUG演示代码
- 火狐textarea输入法的bug的触发及解决
- js隐式全局变量造成的bug示例代码