ChatGPT簡介
ChatGPT&DALLE2是OpenAI的最新研究成果,在量子位看到他的強(qiáng)大功能后,就自己試玩了一下,比如我讓ChatGPT幫我寫一個(gè)GraphSage模型,ChatGPT先簡單解釋了一下GraphSage,然后寫出了不錯(cuò)的PyTorch代碼 (詳見見示例一),是不是很神奇?
ChatGPT&DALLE2試用攻略
在我將量子位的公眾號文章轉(zhuǎn)發(fā)朋友圈之后,很多人遇到了怎么注冊的問題,China是不允許注冊的,注冊過程需要手機(jī)號,一種簡單的方式是找國外的同學(xué)/朋友借,另一種是直接淘寶買,只有幾塊錢。直接登陸,在下圖輸入框輸入你想讓他做的事,點(diǎn)擊右側(cè)小三角(DALLE2是Generate按鈕)即可。
示例一 寫代碼
寫東西需要用ChatGPT,網(wǎng)址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,網(wǎng)址DALL·E文章來源:http://www.zghlxwxcb.cn/news/detail-510407.html
文章來源地址http://www.zghlxwxcb.cn/news/detail-510407.html
到了這里,關(guān)于AI寫代碼修Bug畫畫寫詩,ChatGPT&DALLE2試用攻略的文章就介紹完了。如果您還想了解更多內(nèi)容,請?jiān)谟疑辖撬阉鱐OY模板網(wǎng)以前的文章或繼續(xù)瀏覽下面的相關(guān)文章,希望大家以后多多支持TOY模板網(wǎng)!