日韩成人免费在线_国产成人一二_精品国产免费人成电影在线观..._日本一区二区三区久久久久久久久不

當前位置:首頁 > 科技  > 知識百科

自動編程NLP模型技術綜述 譯文

來源: 責編: 時間:2023-08-07 16:30:23 224觀看
導讀 Copilot、Codex和AlphaCode:自動編程的計算機程序現況近年來,由于自然語言處理領域轉換器(transformers)的興起,我們看到了一系列令人震驚的代碼編寫深度學習模型。能夠編寫計算

Copilot、Codex和AlphaCode:自動編程的計算機程序現況g8728資訊網——每日最新資訊28at.com

近年來,由于自然語言處理領域轉換器(transformers)的興起,我們看到了一系列令人震驚的代碼編寫深度學習模型。能夠編寫計算機程序的計算機程序,通常稱為程序合成問題,至少從20世紀60年代末和20世紀70年代初就已開始研究。g8728資訊網——每日最新資訊28at.com

在21世紀10年代和20年代,基于注意力的模型在其他領域的成功再次激發了程序合成研究的動力,即在數百GB的文本上預先訓練具有數百萬或數十億參數的大規模基于注意力的神經模型(轉換器)的策略。g8728資訊網——每日最新資訊28at.com

經過預訓練的模型在元學習方面表現出了令人印象深刻的能力,這得益于它們的注意力機制,并且似乎可以實際應用于文本任務開發方面——通過在提示內容中僅提供少數幾個示例(研究文獻中稱作“零樣本或小樣本學習”)。g8728資訊網——每日最新資訊28at.com

基于深層NLP模型的現代程序合成g8728資訊網——每日最新資訊28at.com

NLP模型可以進一步使用專門的數據集進行訓練,以微調特定任務的性能。編寫代碼就是這方面應用的一個特別有趣的使用場景。g8728資訊網——每日最新資訊28at.com

GitHub上的Copilot項目,被宣傳為“你的人工智能編程伙伴(Your AI Pair Programmer)”,在2021推出時引起不小的爭議。在很大程度上,這是由于在訓練數據集中使用了所有公開的GitHub代碼。根據有關說明,這些代碼庫包括具有Copyleft許可證的項目,這些項目可能不允許將代碼用于Copilot等項目,除非Copilot本身是開源的。g8728資訊網——每日最新資訊28at.com

Copilot是OpenAI組織和微軟公司之間關系的產物,基于GPT-3的一個經過代碼訓練的版本。由OpenAI演示并通過其API提供的版本稱為Codex。使用Copex的正式實驗描述在陳先生等人于2021年發表的論文中有詳細的介紹。g8728資訊網——每日最新資訊28at.com

2022年初,DeepMind公司也不甘示弱,開發出他們自己的程序合成深度NLP系統:AlphaCode。g8728資訊網——每日最新資訊28at.com

新挑戰者:AlphaCodeg8728資訊網——每日最新資訊28at.com

與之前的Codex和Copilot一樣,AlphaCode是一個設計和訓練用于編寫代碼的大型NLP模型。如Copilot一樣,AlphaCode的開發也不是為了將AlphaCode作為軟件工程師的生產力工具,而是用于在競賽類編程任務中挑戰人類水平的編程性能。g8728資訊網——每日最新資訊28at.com

用于訓練和評估AlphaCode(組成新的CodeContests數據集)的競賽編碼挑戰的難度介于以前數據集難度和現實世界軟件工程難度之間。g8728資訊網——每日最新資訊28at.com

對于那些不熟悉競賽類編程挑戰網站的人來說,這項任務有點像測試驅動開發的簡化版本。根據給定的一些文本描述和幾個例程,這種挑戰的主要內容就是,編寫一個通過一組測試的程序——其中大部分測試對程序員來說都是隱藏的。g8728資訊網——每日最新資訊28at.com

理想情況下,隱藏測試應該是全面的,通過所有測試也就代表順利解決了給定的問題。但是,用單元測試覆蓋每個邊緣情況是一個困難的問題。對程序合成領域的一個重要貢獻實際上是CodeContests數據集本身,因為DeepMind團隊做出了重大努力——他們通過突變過程生成額外的測試,目的是為了降低誤報率(測試通過,但問題尚未解決)和慢陽性率(測試通過,但解決方案太慢)。g8728資訊網——每日最新資訊28at.com

AlphaCode的性能是根據競賽網站CodeForces上的競賽編程挑戰內容進行評估的。總體上,AlphaCode在參與競賽的(也可能是人類)程序員中的平均表現為“前54.3%”。g8728資訊網——每日最新資訊28at.com

請注意,該指標可能有點誤導,因為它實際上等同于45.7%的績效。令人難以置信的是,AlphaCode系統能夠編寫任何通過所有隱藏測試的算法。但是,請注意:AlphaCode使用了一種與人類截然不同的策略來解決編程問題。g8728資訊網——每日最新資訊28at.com

雖然人類競爭對手可能會編寫一種算法來解決大多數例程——結合運行早期版本解決方案的見解不斷改進,直到通過所有測試;但是,AlphaCode采用了一種基礎更廣泛的方法,即為每個問題生成多個樣本,然后選擇10個樣本提交。g8728資訊網——每日最新資訊28at.com

AlphaCode在CodeContests數據集上的性能的一大貢獻是,生成后過濾和聚類的結果:它在生成大約1000000個候選解決方案后,開始過濾候選方案,以刪除問題描述中未通過示例測試的候選方案,從而消除大約99%的候選群體。g8728資訊網——每日最新資訊28at.com

作者提到,大約10%的問題沒有通過此階段所有示例測試的候選解決方案。g8728資訊網——每日最新資訊28at.com

然后通過聚類將剩余的候選項篩選到10份或更少的提交。簡而言之,他們訓練了另一個模型,以根據問題描述生成額外的測試輸入(但請注意,他們沒有這些測試的有效輸出)。g8728資訊網——每日最新資訊28at.com

剩余的候選解決方案(過濾后的數量可能小于1000個),根據其在生成的測試輸入上的輸出進行聚類。按照從最大到最小的順序,從每個集群中選擇一個候選對象進行提交。如果簇少于10個,則對簇進行多次采樣。g8728資訊網——每日最新資訊28at.com

雖然過濾/聚類步驟是獨特的,并且AlphaCode在新的CodeContests數據集上進行了微調,但它最初的訓練方式與Codex或Copilot大致相同。AlphaCode首先在GitHub(2021年7月14日檢索)的一個大型公共可用代碼數據集上接受了預訓練。他們訓練了5種變型,參數個數從2.84億個增加到410億個。g8728資訊網——每日最新資訊28at.com

與AlphaGo系列或玩星際爭霸II游戲的AlphaStar機器人的精神一樣,AlphaCode也是一個研究項目,旨在開發一個接近人類在專門任務領域的能力的系統,而且在程序合成過程中開發出的實用程序的門檻更低。g8728資訊網——每日最新資訊28at.com

從開發解決問題的實用工具的角度來說,這方面機器人的代表是基于GPT-3的Codex和Copilot工具。Codex是GPT-3的OpenAI變體,在一個公共可用代碼的語料庫上進行訓練。根據與論文一起發布的HumanEval數據集,OpenAI報告稱,Codex通過在“docstring to code”格式的任務中生成100個樣本,能夠解決70%以上的問題。g8728資訊網——每日最新資訊28at.com

接下來,我們將探索這種通過使用Codex自動生成代碼的提示符編程技術。我們將同時使用下面給定的模型來開發約翰·康威的《生命游戲》。g8728資訊網——每日最新資訊28at.com

GitHub Copilot采用代碼自動補全的方法,目前的打包形式是Visual Studio,VSCode,Neovim和JetBrains等集成開發環境的擴展的方式。根據Copilot網頁有關描述,Copilot已能夠成功地根據給定描述重新編寫出一組經過良好測試的Python函數,其中57%的函數與HumanEval數據集類似。g8728資訊網——每日最新資訊28at.com

我們將研究Copilot的一些實際用例,例如使用VSCode的專用測試版的Copilot擴展自動編寫測試。g8728資訊網——每日最新資訊28at.com

提示符編程:用Codex編寫康威的《生命游戲》g8728資訊網——每日最新資訊28at.com

在本節中,我們將介紹基于約翰·康威的《生命游戲》編寫細胞自動機模擬器的任務。稍加了一點修改,沒有對規則硬編碼,我們的程序應該能夠模擬任何一組類生命的細胞自動機規則。g8728資訊網——每日最新資訊28at.com

我們將采用交互式方法,而不是通過生成100個示例并選擇最佳示例(可以是手動方式也可以通過運行測試的方式)。當Codex給出一個糟糕的解決方案的時候,我們將做出調整以嘗試引導更好的答案。當然,如果絕對必要的話,在Codex完全失敗的情況下,我們可以繼續修改代碼以獲得一個能夠正常工作的示例。g8728資訊網——每日最新資訊28at.com

編寫一個逼真的CA(Cellular Automata,即“元胞自動機”。它是一種時間、空間、狀態都離散,空間相互作用和時間因果關系為局部的網格動力學模型,具有模擬復雜系統時空演化過程的能力)模擬器的第一步是提出一個計算鄰居的函數。我們編寫了以下docstring提示符,并將其提供給code-davinci-001,這是OpenAI API庫中最大的Codex模型:g8728資訊網——每日最新資訊28at.com

# PROMPTg8728資訊網——每日最新資訊28at.com
import numpy as npg8728資訊網——每日最新資訊28at.com
def compute_neighborhood(grid: np.array) -> np.array:g8728資訊網——每日最新資訊28at.com
"""g8728資訊網——每日最新資訊28at.com
Compute the sum of cell states in the Moore neighborhoodg8728資訊網——每日最新資訊28at.com
for each cell in the input grid.g8728資訊網——每日最新資訊28at.com
A Moore neighborhood includes 8 cells,g8728資訊網——每日最新資訊28at.com
diagonally and orthogonally adjacent to, but not including, the center cell.g8728資訊網——每日最新資訊28at.com
The cells denoted by '1' correspond to the Moore neighborhood for cell a:g8728資訊網——每日最新資訊28at.com
1 1 1g8728資訊網——每日最新資訊28at.com
1 a 1g8728資訊網——每日最新資訊28at.com
1 1 1g8728資訊網——每日最新資訊28at.com
If cell 'a' is on the edge of the grid,g8728資訊網——每日最新資訊28at.com
the Moore neighborhood wraps around to the cells on the opposite edge,g8728資訊網——每日最新資訊28at.com
i.e. grid is on a toroid.g8728資訊網——每日最新資訊28at.com
g8728資訊網——每日最新資訊28at.com
args:g8728資訊網——每日最新資訊28at.com
grid, a numpy array with binary values 0 or 1. grid contains the current cell state valuesg8728資訊網——每日最新資訊28at.com
Returns:g8728資訊網——每日最新資訊28at.com
g8728資訊網——每日最新資訊28at.com
neighorhood_grid, a numpy array with integer values from 0 to 8.g8728資訊網——每日最新資訊28at.com
For each cell (element in grid) in grid, neighborhood_grid shouldg8728資訊網——每日最新資訊28at.com
contain the sum of states in that cell's Moore neighborhoodg8728資訊網——每日最新資訊28at.com
"""g8728資訊網——每日最新資訊28at.com

上述代碼中,加入注釋行“# PROMPT”和“# GENERATED”是為了更清楚地說明提示符從哪兒結束。g8728資訊網——每日最新資訊28at.com

你仔細分析上面相當全面的docstring提示了沒有?Codex是怎么做的?其實,Codex的第一次嘗試如下:g8728資訊網——每日最新資訊28at.com

# GENERATEDg8728資訊網——每日最新資訊28at.com
# TODO: implement this functiong8728資訊網——每日最新資訊28at.com
passg8728資訊網——每日最新資訊28at.com

這對我們的小實驗來說可能不是好兆頭。即使在調整P值超參數以實現更寬松的核采樣(并希望更好的多樣性)后,Codex似乎仍未給出上述問題的答案。g8728資訊網——每日最新資訊28at.com

幸運的是,我們只需在docstring提示符上添加一點類似于下面的內容,Codex就會產生一個更有希望的輸出。g8728資訊網——每日最新資訊28at.com

# PROMPT (appended to previous prompt)g8728資訊網——每日最新資訊28at.com
g8728資訊網——每日最新資訊28at.com
this function is completed and does not include any TODOsg8728資訊網——每日最新資訊28at.com
"""g8728資訊網——每日最新資訊28at.com
g8728資訊網——每日最新資訊28at.com
# GENERATEDg8728資訊網——每日最新資訊28at.com
g8728資訊網——每日最新資訊28at.com
# get the dimensions of the gridg8728資訊網——每日最新資訊28at.com
n_rows, n_cols = grid.shapeg8728資訊網——每日最新資訊28at.com
g8728資訊網——每日最新資訊28at.com
# initialize the output arrayg8728資訊網——每日最新資訊28at.com
neighborhood_grid = np.zeros((n_rows, n_cols), dtype=int)g8728資訊網——每日最新資訊28at.com
g8728資訊網——每日最新資訊28at.com
# loop over the gridg8728資訊網——每日最新資訊28at.com
for i in range(n_rows):g8728資訊網——每日最新資訊28at.com
for j in range(n_cols):g8728資訊網——每日最新資訊28at.com
g8728資訊網——每日最新資訊28at.com
# get the current cell valueg8728資訊網——每日最新資訊28at.com
cell_val = grid[i, j]g8728資訊網——每日最新資訊28at.com
g8728資訊網——每日最新資訊28at.com
# get the Moore neighborhood of the current cellg8728資訊網——每日最新資訊28at.com
# using the get_neighborhood functiong8728資訊網——每日最新資訊28at.com
neighborhood = get_neighborhood(grid, i, j)g8728資訊網——每日最新資訊28at.com
g8728資訊網——每日最新資訊28at.com
# sum the cell values in the neighborhoodg8728資訊網——每日最新資訊28at.com
neighborhood_sum = np.sum(neighborhood)g8728資訊網——每日最新資訊28at.com
g8728資訊網——每日最新資訊28at.com
# store the sum in the neighborhood gridg8728資訊網——每日最新資訊28at.com
neighborhood_grid[i, j] = neighborhood_sumg8728資訊網——每日最新資訊28at.com
g8728資訊網——每日最新資訊28at.com
return neighborhood_gridg8728資訊網——每日最新資訊28at.com

當然,這還不是一個很好的解決方案,因為它引入了一個未使用的變量cell_val,并將其大部分工作委托給它剛剛添加的另一個函數get_neighborhood。但總的來說,這看起來是一個可行的開始。g8728資訊網——每日最新資訊28at.com

接下來,我們為上面提到的get_neighborhood函數編寫了一個簡單的docstring:g8728資訊網——每日最新資訊28at.com

def get_neighborhood(grid: np.array, i: int, j: int) -> np.array:g8728資訊網——每日最新資訊28at.com
"""g8728資訊網——每日最新資訊28at.com
get_neighborhood is used by compute_neighborhood g8728資訊網——每日最新資訊28at.com
to return the 3x3 Moore neighborhood for the cell g8728資訊網——每日最新資訊28at.com
located at coordinates i,j If i,j coordinates are g8728資訊網——每日最新資訊28at.com
on the edge of the grid (i.e. i or j equal 0, or i == g8728資訊網——每日最新資訊28at.com
grid.shape[0]-1 or j == grid.shape[1]), the Mooreg8728資訊網——每日最新資訊28at.com
Neighborhood should wrap around to include cells on theg8728資訊網——每日最新資訊28at.com
opposite edge. In other words the grid can be considered to g8728資訊網——每日最新資訊28at.com
be the surface of a toroid, like 'Pac-Man'g8728資訊網——每日最新資訊28at.com
g8728資訊網——每日最新資訊28at.com
args:g8728資訊網——每日最新資訊28at.com
grid, np.array, this is the current state ofg8728資訊網——每日最新資訊28at.com
the cellular automata gridg8728資訊網——每日最新資訊28at.com
i, int, this coordinate corresponds to the rowg8728資訊網——每日最新資訊28at.com
j, int, coordinate corresponding to columng8728資訊網——每日最新資訊28at.com
g8728資訊網——每日最新資訊28at.com
returns:g8728資訊網——每日最新資訊28at.com
moore_neighborhood - np.array, should always haveg8728資訊網——每日最新資訊28at.com
dimensions 3x3 andg8728資訊網——每日最新資訊28at.com
contain the Moore neighborhood for the cell at i,j g8728資訊網——每日最新資訊28at.com
in grid.Because the center cell is not part of theg8728資訊網——每日最新資訊28at.com
neighborhood, moore_neighborhood[1,1] should always g8728資訊網——每日最新資訊28at.com
be 0g8728資訊網——每日最新資訊28at.com
"""g8728資訊網——每日最新資訊28at.com
g8728資訊網——每日最新資訊28at.com
# GENERATEDg8728資訊網——每日最新資訊28at.com
g8728資訊網——每日最新資訊28at.com
# get the dimensions of the gridg8728資訊網——每日最新資訊28at.com
n_rows, n_cols = grid.shapeg8728資訊網——每日最新資訊28at.com
g8728資訊網——每日最新資訊28at.com
# initialize the output arrayg8728資訊網——每日最新資訊28at.com
moore_neighborhood = np.zeros((3, 3), dtype=int)g8728資訊網——每日最新資訊28at.com
g8728資訊網——每日最新資訊28at.com
# get the coordinates of the Moore neighborhoodg8728資訊網——每日最新資訊28at.com
# using the get_neighborhood_coordinates functiong8728資訊網——每日最新資訊28at.com
neighborhood_coords = g8728資訊網——每日最新資訊28at.com
get_neighborhood_coordinates(i, j, n_rows, n_cols)g8728資訊網——每日最新資訊28at.com
g8728資訊網——每日最新資訊28at.com
# loop over the coordinatesg8728資訊網——每日最新資訊28at.com
for coord in neighborhood_coords:g8728資訊網——每日最新資訊28at.com
# get the cell value at the coordinateg8728資訊網——每日最新資訊28at.com
cell_val = grid[coord[0], coord[1]]g8728資訊網——每日最新資訊28at.com
g8728資訊網——每日最新資訊28at.com
# store the cell value in the output arrayg8728資訊網——每日最新資訊28at.com
moore_neighborhood[coord[0], coord[1]] = cell_valg8728資訊網——每日最新資訊28at.com
g8728資訊網——每日最新資訊28at.com
return moore_neighborhoodg8728資訊網——每日最新資訊28at.com

上面程序的輸出看起來也算可行;但經過檢查,它實際上包含了一個重要錯誤。g8728資訊網——每日最新資訊28at.com

在鄰居坐標的循環中,它使用與從網格中檢索值相同的坐標為摩爾鄰居(Moore neighborhood)賦值。g8728資訊網——每日最新資訊28at.com

我們沒有找到提示Codex避免錯誤的明確方法;因此,我們只好手動修改一下代碼:g8728資訊網——每日最新資訊28at.com

# FIXED loop over the coordinates g8728資訊網——每日最新資訊28at.com
for index, coord in enumerate(neighborhood_coords): g8728資訊網——每日最新資訊28at.com
# get the cell value at the coordinate g8728資訊網——每日最新資訊28at.com
cell_val = grid[coord[0], coord[1]] g8728資訊網——每日最新資訊28at.com
g8728資訊網——每日最新資訊28at.com
# FIXED store the cell value in the output array g8728資訊網——每日最新資訊28at.com
moore_neighborhood[index // 3, index % 3] = cell_val g8728資訊網——每日最新資訊28at.com
g8728資訊網——每日最新資訊28at.com
return moore_neighborhoodg8728資訊網——每日最新資訊28at.com

另外,前面代碼中還引入了另一個函數get_neighborhood_coordinates來處理比較“棘手”的部分。g8728資訊網——每日最新資訊28at.com

接下來,我們要為函數get_neighborhood_coordinates編寫一個提示符。g8728資訊網——每日最新資訊28at.com

# PROMPT g8728資訊網——每日最新資訊28at.com
def get_neighborhood_coordinates(g8728資訊網——每日最新資訊28at.com
i: int, j: int, n_rows: int, n_cols: int) -> list:g8728資訊網——每日最新資訊28at.com
"""g8728資訊網——每日最新資訊28at.com
get_neighborhood_coordinates is used by get_neighborhood g8728資訊網——每日最新資訊28at.com
to return the coordinates of the 3x3 Moore neighborhood forg8728資訊網——每日最新資訊28at.com
the cell located at coordinates i,j If i,j coordinates are ong8728資訊網——每日最新資訊28at.com
the edge of the grid (i.e. i or j equal 0, or i == g8728資訊網——每日最新資訊28at.com
grid.shape[0]-1 or j == grid.shape[1]), the Mooreg8728資訊網——每日最新資訊28at.com
Neighborhood should wrap around to include cells on the g8728資訊網——每日最新資訊28at.com
opposite edge. In other words the grid can be considered to g8728資訊網——每日最新資訊28at.com
be the surface of a toroid, like 'Pac-Man'g8728資訊網——每日最新資訊28at.com
g8728資訊網——每日最新資訊28at.com
args:g8728資訊網——每日最新資訊28at.com
i, int, this coordinate corresponds to the rowg8728資訊網——每日最新資訊28at.com
j, int, coordinate corresponding to columng8728資訊網——每日最新資訊28at.com
n_rows, int, number of rows in the gridg8728資訊網——每日最新資訊28at.com
n_cols, int, number of columns in the gridg8728資訊網——每日最新資訊28at.com
g8728資訊網——每日最新資訊28at.com
returns:g8728資訊網——每日最新資訊28at.com
neighborhood_coords - list of tuples, g8728資訊網——每日最新資訊28at.com
each tuple contains the coordinatesg8728資訊網——每日最新資訊28at.com
of a cell in the Moore neighborhoodg8728資訊網——每日最新資訊28at.com
"""g8728資訊網——每日最新資訊28at.com
g8728資訊網——每日最新資訊28at.com
# GENERATEDg8728資訊網——每日最新資訊28at.com
g8728資訊網——每日最新資訊28at.com
# initialize the output listg8728資訊網——每日最新資訊28at.com
neighborhood_coords = []g8728資訊網——每日最新資訊28at.com
g8728資訊網——每日最新資訊28at.com
# get the coordinates of the Moore neighborhoodg8728資訊網——每日最新資訊28at.com
# using the get_neighborhood_coordinates functiong8728資訊網——每日最新資訊28at.com
for row in range(i-1, i+2):g8728資訊網——每日最新資訊28at.com
for col in range(j-1, j+2):g8728資訊網——每日最新資訊28at.com
# skip the center cellg8728資訊網——每日最新資訊28at.com
if row == i and col == j:g8728資訊網——每日最新資訊28at.com
continueg8728資訊網——每日最新資訊28at.com
g8728資訊網——每日最新資訊28at.com
# check if the cell is on the edge of the gridg8728資訊網——每日最新資訊28at.com
# if so, wrap around to the opposite edgeg8728資訊網——每日最新資訊28at.com
if row < 0:g8728資訊網——每日最新資訊28at.com
row = n_rows - 1g8728資訊網——每日最新資訊28at.com
elif row == n_rows:g8728資訊網——每日最新資訊28at.com
row = 0g8728資訊網——每日最新資訊28at.com
g8728資訊網——每日最新資訊28at.com
if col < 0:g8728資訊網——每日最新資訊28at.com
col = n_cols - 1g8728資訊網——每日最新資訊28at.com
elif col == n_cols:g8728資訊網——每日最新資訊28at.com
col = 0g8728資訊網——每日最新資訊28at.com
g8728資訊網——每日最新資訊28at.com
# store the cell coordinatesg8728資訊網——每日最新資訊28at.com
neighborhood_coords.append((row, col))g8728資訊網——每日最新資訊28at.com
g8728資訊網——每日最新資訊28at.com
return neighborhood_coordsg8728資訊網——每日最新資訊28at.com

這比我們預期的函數式編程深度要深一點(compute_neighborhood調用get_neighborhood,反過來get_neighborhood又調用get_neighborhood_coordinates),但看起來我們終于有了一組函數,可以返回一個鄰居和的網格。g8728資訊網——每日最新資訊28at.com

還剩下update函數,它對應的docstring提示如下所示:g8728資訊網——每日最新資訊28at.com

# PROMPTg8728資訊網——每日最新資訊28at.com
g8728資訊網——每日最新資訊28at.com
def update_grid(grid: np.array, rules: list) -> np.array:g8728資訊網——每日最新資訊28at.com
"""g8728資訊網——每日最新資訊28at.com
update input arg grid according the the Life-like rulesg8728資訊網——每日最新資訊28at.com
contained in input arg rules. rules is a list of lists, g8728資訊網——每日最新資訊28at.com
with the first element containing a list of 'birth'g8728資訊網——每日最新資訊28at.com
conditions (cells go from 0 -> 1) and the second elementg8728資訊網——每日最新資訊28at.com
containing a list of 'survival' conditions (cells areg8728資訊網——每日最新資訊28at.com
unchanged).g8728資訊網——每日最新資訊28at.com
Cells which have a neighborhood sum that is not in theg8728資訊網——每日最新資訊28at.com
'birth' (B) or 'survival' (S) rules go to 0. g8728資訊網——每日最新資訊28at.com
g8728資訊網——每日最新資訊28at.com
This functions uses function compute_neighborhood to compute g8728資訊網——每日最新資訊28at.com
the neighborhood value for each cell in grid.g8728資訊網——每日最新資訊28at.com
g8728資訊網——每日最新資訊28at.com
args:g8728資訊網——每日最新資訊28at.com
grid, np.array. grid contains the cell values (0 or 1)g8728資訊網——每日最新資訊28at.com
rules, list of lists. rules contains the B/S rules g8728資訊網——每日最新資訊28at.com
for Life-like cellular automata for example, tog8728資訊網——每日最新資訊28at.com
simulate Conway's Life CA, `rules = [[3], [2,3]]`,g8728資訊網——每日最新資訊28at.com
i.e. B3/S23 Life Without Death has rulesg8728資訊網——每日最新資訊28at.com
B3/S012345678, so `rules = [[3],g8728資訊網——每日最新資訊28at.com
[0,1,2,3,4,5,6,7,8]]`g8728資訊網——每日最新資訊28at.com
g8728資訊網——每日最新資訊28at.com
update_grid should raise an Exception if rules contains g8728資訊網——每日最新資訊28at.com
values greater than 8 (maximum number of live cells in ag8728資訊網——每日最新資訊28at.com
Moore neighborhood) or less than 0. g8728資訊網——每日最新資訊28at.com
"""g8728資訊網——每日最新資訊28at.com
g8728資訊網——每日最新資訊28at.com
# GENERATEDg8728資訊網——每日最新資訊28at.com
g8728資訊網——每日最新資訊28at.com
# get the dimensions of the gridg8728資訊網——每日最新資訊28at.com
n_rows, n_cols = grid.shapeg8728資訊網——每日最新資訊28at.com
g8728資訊網——每日最新資訊28at.com
# get the neighborhood gridg8728資訊網——每日最新資訊28at.com
neighborhood_grid = compute_neighborhood(grid)g8728資訊網——每日最新資訊28at.com
g8728資訊網——每日最新資訊28at.com
# loop over the gridg8728資訊網——每日最新資訊28at.com
for i in range(n_rows):g8728資訊網——每日最新資訊28at.com
for j in range(n_cols):g8728資訊網——每日最新資訊28at.com
# get the current cell valueg8728資訊網——每日最新資訊28at.com
cell_val = grid[i, j]g8728資訊網——每日最新資訊28at.com
g8728資訊網——每日最新資訊28at.com
# get the neighborhood value for the current cellg8728資訊網——每日最新資訊28at.com
neighborhood_val = neighborhood_grid[i, j]g8728資訊網——每日最新資訊28at.com
g8728資訊網——每日最新資訊28at.com
# check if the cell is aliveg8728資訊網——每日最新資訊28at.com
if cell_val == 1:g8728資訊網——每日最新資訊28at.com
# check if the cell should dieg8728資訊網——每日最新資訊28at.com
if neighborhood_val not in rules[1]:g8728資訊網——每日最新資訊28at.com
grid[i, j] = 0g8728資訊網——每日最新資訊28at.com
else:g8728資訊網——每日最新資訊28at.com
# check if the cell should be borng8728資訊網——每日最新資訊28at.com
if neighborhood_val in rules[0]:g8728資訊網——每日最新資訊28at.com
grid[i, j] = 1g8728資訊網——每日最新資訊28at.com
g8728資訊網——每日最新資訊28at.com
return gridg8728資訊網——每日最新資訊28at.com

這看起來是解決上面問題的一種非常合理的方法;盡管我們確實明確建議,如果鄰居網格包含錯誤的值并且在生成的輸出中找不到,就會引發異常。g8728資訊網——每日最新資訊28at.com

只需進行一些修復:在函數get_neighborhood中進行手動干預,并且嘗試給出一些提示,我們就可以成功地設計出一個完全可行的類似生命的細胞自動機模擬器。g8728資訊網——每日最新資訊28at.com

上面的代碼不是一個特別快的實現方案,但它的質量與程序員在開始使用一種新語言時可能做出的那種“Hello World”嘗試相似。值得注意的是,在訓練數據集中包含了許多示例,供研究者參考。g8728資訊網——每日最新資訊28at.com

在康威的《生命游戲》中,我們可以想象這段程序在微型滑翔機的發展過程中取得的成功。g8728資訊網——每日最新資訊28at.com

g8728資訊網——每日最新資訊28at.com

雖然我們確實通過一組函數完成了CA模擬器的編寫,但這種方法對于日常軟件工程來說并不是非常有用或現實的開發方式。但另一方面,這并不能阻止像SourceAI這樣的初創公司(本質上是OpenAI Codex API的包裝商)將其服務宣傳為“給每個人創造有價值的定制軟件的機會”。g8728資訊網——每日最新資訊28at.com

“我們構建了一個獨立的系統,可以開發出世界上最熟練的工程師級別的軟件。”不過,與Codex交互的確是學習或實踐編程的一種潛在有用的方式,尤其是針對CodeSignal、CodeForces或HackerRank等網站的編程問題方面。g8728資訊網——每日最新資訊28at.com

接下來,我們將嘗試評估Codex/Copilot,以獲得自動編寫測試和docstring的更現實的使用情形。g8728資訊網——每日最新資訊28at.com

任務2:編寫測試g8728資訊網——每日最新資訊28at.com

對于本例來說,我們選擇使用VSCode開發工具的GitHub Copilot擴展來編寫測試。g8728資訊網——每日最新資訊28at.com

# PROMPT (in VSCode)g8728資訊網——每日最新資訊28at.com
import numpy as npg8728資訊網——每日最新資訊28at.com
def pythagorean(a: np.float, b: np.float) -> np.float:g8728資訊網——每日最新資訊28at.com
"""g8728資訊網——每日最新資訊28at.com
Use the Pythagorean theorem to comput the hypotenuse forg8728資訊網——每日最新資訊28at.com
a triangle with side lengths a and bg8728資訊網——每日最新資訊28at.com
g8728資訊網——每日最新資訊28at.com
args:g8728資訊網——每日最新資訊28at.com
a, np.float, side of the triangleg8728資訊網——每日最新資訊28at.com
b, np.float, the other side of the triangleg8728資訊網——每日最新資訊28at.com
g8728資訊網——每日最新資訊28at.com
returns:g8728資訊網——每日最新資訊28at.com
c, np.float, the length of the hypotenuseg8728資訊網——每日最新資訊28at.com
"""g8728資訊網——每日最新資訊28at.com
c = np.sqrt(a**2 + b**2)g8728資訊網——每日最新資訊28at.com
return cg8728資訊網——每日最新資訊28at.com
g8728資訊網——每日最新資訊28at.com
def test_pythagorean():g8728資訊網——每日最新資訊28at.com
g8728資訊網——每日最新資訊28at.com
# GENERATED (Copilot autocomplete)g8728資訊網——每日最新資訊28at.com
"""g8728資訊網——每日最新資訊28at.com
Test the pythagorean functiong8728資訊網——每日最新資訊28at.com
"""g8728資訊網——每日最新資訊28at.com
a = np.array([3, 4, 5])g8728資訊網——每日最新資訊28at.com
b = np.array([4, 5, 6])g8728資訊網——每日最新資訊28at.com
c = pythagorean(a, b)g8728資訊網——每日最新資訊28at.com
g8728資訊網——每日最新資訊28at.com
assert np.allclose(c, np.sqrt(a**2 + b**2))g8728資訊網——每日最新資訊28at.com

雖然畢達哥拉斯定理函數可能過于簡單,但Copilot建議進行一次合理的測試。如果您運行它,它就會通過。你會注意到,自動完成建議能夠正確地獲得測試的結構和數字內容。g8728資訊網——每日最新資訊28at.com

如果我們想使用自己喜歡的框架以更系統的方式編寫測試,該怎么辦?不用太擔心,因為我們已經使用numpy庫和自動微分技術編寫了大量的低級學習模型,供給測試者使用。因此,雖然接下來的這個示例不是100%真實地來自真實世界,但效果還是比較貼近真實情況的。g8728資訊網——每日最新資訊28at.com

在本例中,我們將使用autograd和numpy以及unittest中的TestCase類設置一個簡單的多層感知器前向傳遞、損失函數和梯度函數進行測試。g8728資訊網——每日最新資訊28at.com

#PROMPTg8728資訊網——每日最新資訊28at.com
import unittestg8728資訊網——每日最新資訊28at.com
from autograd import numpy as npg8728資訊網——每日最新資訊28at.com
from autograd import gradg8728資訊網——每日最新資訊28at.com
g8728資訊網——每日最新資訊28at.com
def forward_mlp(input_x: np.array, g8728資訊網——每日最新資訊28at.com
weights: list, biases: list) -> np.array:g8728資訊網——每日最新資訊28at.com
"""g8728資訊網——每日最新資訊28at.com
compute the forward pass of a multilayer perceptron. g8728資訊網——每日最新資訊28at.com
The number of layers is equal to the length of the list ofg8728資訊網——每日最新資訊28at.com
weights, which must be the same as the list of biases,g8728資訊網——每日最新資訊28at.com
biases. g8728資訊網——每日最新資訊28at.com
g8728資訊網——每日最新資訊28at.com
args:g8728資訊網——每日最新資訊28at.com
input_x, np.array, input datag8728資訊網——每日最新資訊28at.com
weights, list of np.arrays, a list of np.array matrices,g8728資訊網——每日最新資訊28at.com
representing the weightsg8728資訊網——每日最新資訊28at.com
biases: list of np.arrays, a list of biases for eachg8728資訊網——每日最新資訊28at.com
layerg8728資訊網——每日最新資訊28at.com
g8728資訊網——每日最新資訊28at.com
returns: g8728資訊網——每日最新資訊28at.com
result, np.array, the output of the networkg8728資訊網——每日最新資訊28at.com
"""g8728資訊網——每日最新資訊28at.com
g8728資訊網——每日最新資訊28at.com
assert len(weights) == len(biases)g8728資訊網——每日最新資訊28at.com
g8728資訊網——每日最新資訊28at.com
for layer_index in range(len(weights) - 1):g8728資訊網——每日最新資訊28at.com
input_x = np.tanh(np.matmul(input_x,g8728資訊網——每日最新資訊28at.com
weights[layer_index]) + biases[layer_index])g8728資訊網——每日最新資訊28at.com
g8728資訊網——每日最新資訊28at.com
output = np.matmul(input_x, weights[-1]) + biases[-1]g8728資訊網——每日最新資訊28at.com
return outputg8728資訊網——每日最新資訊28at.com
def get_loss(input_x: np.array, weights: list, g8728資訊網——每日最新資訊28at.com
biases: list, target: np.array) -> np.float:g8728資訊網——每日最新資訊28at.com
"""g8728資訊網——每日最新資訊28at.com
compute the mean squared error loss for an mlp with weightsg8728資訊網——每日最新資訊28at.com
and biases, with respect to the input data input_x and theg8728資訊網——每日最新資訊28at.com
target array target.g8728資訊網——每日最新資訊28at.com
g8728資訊網——每日最新資訊28at.com
args:g8728資訊網——每日最新資訊28at.com
input_x, np.array, input datag8728資訊網——每日最新資訊28at.com
weights, list of np.arrays, a list of np.array matrices,g8728資訊網——每日最新資訊28at.com
representing the weightsg8728資訊網——每日最新資訊28at.com
biases: list of np.arrays, a list of biases for eachg8728資訊網——每日最新資訊28at.com
layerg8728資訊網——每日最新資訊28at.com
target: np.array, the target valuesg8728資訊網——每日最新資訊28at.com
g8728資訊網——每日最新資訊28at.com
returns: g8728資訊網——每日最新資訊28at.com
loss, np.float, the lossg8728資訊網——每日最新資訊28at.com
"""g8728資訊網——每日最新資訊28at.com
g8728資訊網——每日最新資訊28at.com
output = forward_mlp(input_x, weights, biases)g8728資訊網——每日最新資訊28at.com
g8728資訊網——每日最新資訊28at.com
return np.mean((output - target)**2)g8728資訊網——每日最新資訊28at.com
g8728資訊網——每日最新資訊28at.com
get_loss_grad = grad(get_loss, argnum=(1,2))g8728資訊網——每日最新資訊28at.com
g8728資訊網——每日最新資訊28at.com
g8728資訊網——每日最新資訊28at.com
class TestMLP(unittest.TestCase):g8728資訊網——每日最新資訊28at.com
"""g8728資訊網——每日最新資訊28at.com
tests for MLP, get_loss, and get_grad_lossg8728資訊網——每日最新資訊28at.com
"""g8728資訊網——每日最新資訊28at.com
# GENERATED (chosen from Copilot suggestions)g8728資訊網——每日最新資訊28at.com
def setUp(self):g8728資訊網——每日最新資訊28at.com
passg8728資訊網——每日最新資訊28at.com
g8728資訊網——每日最新資訊28at.com
def test_forward_mlp(self):g8728資訊網——每日最新資訊28at.com
"""g8728資訊網——每日最新資訊28at.com
test forward_mlpg8728資訊網——每日最新資訊28at.com
"""g8728資訊網——每日最新資訊28at.com
g8728資訊網——每日最新資訊28at.com
input_x = np.array([[1, 2, 3], [4, 5, 6]])g8728資訊網——每日最新資訊28at.com
weights = [np.array([[1, 2], [3, 4]]), g8728資訊網——每日最新資訊28at.com
np.array([[5, 6], [7, 8]]), g8728資訊網——每日最新資訊28at.com
np.array([[9, 10], [11, 12]])]g8728資訊網——每日最新資訊28at.com
biases = [np.array([[1, 2]]), np.array([[3, 4]]),g8728資訊網——每日最新資訊28at.com
np.array([[5, 6]])]g8728資訊網——每日最新資訊28at.com
g8728資訊網——每日最新資訊28at.com
output = forward_mlp(input_x, weights, biases)g8728資訊網——每日最新資訊28at.com
self.assertTrue(np.allclose(output, g8728資訊網——每日最新資訊28at.com
np.array([[-0.9, -0.9], [-0.9, -0.9]])))g8728資訊網——每日最新資訊28at.com
g8728資訊網——每日最新資訊28at.com
def test_get_loss(self):g8728資訊網——每日最新資訊28at.com
"""g8728資訊網——每日最新資訊28at.com
test get_lossg8728資訊網——每日最新資訊28at.com
"""g8728資訊網——每日最新資訊28at.com
input_x = np.array([[1, 2, 3], [4, 5, 6]])g8728資訊網——每日最新資訊28at.com
weights = [np.array([[1, 2], [3, 4]]), g8728資訊網——每日最新資訊28at.com
np.array([[5, 6], [7, 8]]), g8728資訊網——每日最新資訊28at.com
np.array([[9, 10], [11, 12]])]g8728資訊網——每日最新資訊28at.com
biases = [np.array([[1, 2]]), np.array([[3, 4]]),g8728資訊網——每日最新資訊28at.com
np.array([[5, 6]])]g8728資訊網——每日最新資訊28at.com
target = np.array([[1, 1], [1, 1]])g8728資訊網——每日最新資訊28at.com
g8728資訊網——每日最新資訊28at.com
loss = get_loss(input_x, weights, biases, target)g8728資訊網——每日最新資訊28at.com
g8728資訊網——每日最新資訊28at.com
self.assertTrue(np.allclose(loss, 0.5))g8728資訊網——每日最新資訊28at.com
g8728資訊網——每日最新資訊28at.com
def test_get_loss_grad(self):g8728資訊網——每日最新資訊28at.com
"""g8728資訊網——每日最新資訊28at.com
test get_loss_gradg8728資訊網——每日最新資訊28at.com
"""g8728資訊網——每日最新資訊28at.com
g8728資訊網——每日最新資訊28at.com
input_x = np.array([[1, 2, 3], [4, 5, 6]])g8728資訊網——每日最新資訊28at.com
weights = [np.array([[1, 2], [3, 4]]), g8728資訊網——每日最新資訊28at.com
np.array([[5, 6], [7, 8]]), g8728資訊網——每日最新資訊28at.com
np.array([[9, 10], [11, 12]])]g8728資訊網——每日最新資訊28at.com
biases = [np.array([[1, 2]]), np.array([[3, 4]]), g8728資訊網——每日最新資訊28at.com
np.array([[5, 6]])]g8728資訊網——每日最新資訊28at.com
target = np.array([[1, 1], [1, 1]])g8728資訊網——每日最新資訊28at.com
g8728資訊網——每日最新資訊28at.com
loss_grad = get_loss_grad(g8728資訊網——每日最新資訊28at.com
input_x, weights, biases, target)g8728資訊網——每日最新資訊28at.com
g8728資訊網——每日最新資訊28at.com
self.assertTrue(g8728資訊網——每日最新資訊28at.com
np.allclose(loss_grad[0], g8728資訊網——每日最新資訊28at.com
np.array([[-0.9, -0.9], [-0.9, -0.9]])))g8728資訊網——每日最新資訊28at.com
self.assertTrue(g8728資訊網——每日最新資訊28at.com
np.allclose(loss_grad[1], g8728資訊網——每日最新資訊28at.com
np.array([[-0.9, -0.9], [-0.9, -0.9]])))g8728資訊網——每日最新資訊28at.com
self.assertTrue(g8728資訊網——每日最新資訊28at.com
np.allclose(loss_grad[2],g8728資訊網——每日最新資訊28at.com
np.array([[-0.9, -0.9], [-0.9, -0.9]])))g8728資訊網——每日最新資訊28at.com
g8728資訊網——每日最新資訊28at.com
# END GENERATED (the final two lines are part of the prompt)g8728資訊網——每日最新資訊28at.com
if __name__ == "__main__":g8728資訊網——每日最新資訊28at.com
unittest.main(verbosity=1)g8728資訊網——每日最新資訊28at.com

Copilot的建議雖然并不完美,但確實為測試類提供了合理的思路。不過,如果您嘗試原封不動地運行代碼的話,則不會執行任何測試,更不用說通過測試了。g8728資訊網——每日最新資訊28at.com

輸入數據和第一個權重矩陣之間存在維度不匹配,數據類型也是錯誤的(所有數組都是整數數據類型),而且無法使用Autograd梯度函數。g8728資訊網——每日最新資訊28at.com

當然,上面這些問題并不是很難解決,如果用3x2矩陣替換權重矩陣列表中的第一個條目,那么前向傳播應該可以運行。要使得梯度計算測試順利進行,或者需要在np.array定義的數字上添加小數點,或者顯式定義數組數據類型。g8728資訊網——每日最新資訊28at.com

有了這些更改后,測試即可成功執行并失敗,但預期值在數字表現方面還不正確。g8728資訊網——每日最新資訊28at.com

任務3:自動文檔字符串g8728資訊網——每日最新資訊28at.com

Copilot有很大潛力的一項任務是自動編寫文檔,特別是為已經編寫的函數填寫docstring內容。這方面幾乎是比較實用了。g8728資訊網——每日最新資訊28at.com

對于畢達哥拉斯定理的示例程序,Copilot運行結果已經非常接近,但它將問題描述為查找兩點a和b之間的距離,而不是查找邊長c到邊長a和邊長b的距離。不出所料,隨同Copilot一同發行的docstring中的示例也與函數的實際內容不匹配:返回的是一個標量,而不是c的值數組。g8728資訊網——每日最新資訊28at.com

Copilot對前向MLP函數的docstrings的建議也很接近,但并不完全正確。g8728資訊網——每日最新資訊28at.com

g8728資訊網——每日最新資訊28at.com

Copilot支持的自動Docstring建議g8728資訊網——每日最新資訊28at.com

機器能取代我的工作嗎?g8728資訊網——每日最新資訊28at.com

對于軟件工程師來說,程序合成方面的每一項新進展都可能引發一次經濟恐慌。g8728資訊網——每日最新資訊28at.com

畢竟,如果計算機程序能像程序員一樣為計算機編程,難道這不意味著機器應該“取代我們的工作”嗎?不久的將來會這樣嗎?g8728資訊網——每日最新資訊28at.com

從表面上看,答案似乎是“還沒有”;但是,這并不意味著隨著這些工具變得更加成熟,軟件工程的本質可能會保持不變。在未來,使用復雜的自動完成工具成功地進行推理可能與使用代碼格式化工具一樣重要。g8728資訊網——每日最新資訊28at.com

Copilot當前正處于測試版試用階段,關于如何使用它的選項數量有限。同樣,Codex也可以通過OpenAI在測試版中獲得應用程序編程接口。試點項目的使用條款和隱私考慮確實限制了該技術的潛在使用場景。g8728資訊網——每日最新資訊28at.com

根據當前的隱私政策,輸入到這些系統的任何代碼都可以用于微調模型,并且可以由GitHub/Microsoft或OpenAI的員工進行審查。這就排除了在敏感項目中使用Codex或Copilot的可能性。g8728資訊網——每日最新資訊28at.com

Copilot確實為其所基于的Codex模型添加了許多實用程序。您可以為所需的代碼編寫框架或大綱(如為unittest框架的測試編寫示例),并將光標移動到大綱的中間,以獲得合理的OK自動完成建議。g8728資訊網——每日最新資訊28at.com

目前的Copilot,對于任何比簡單的編碼實踐更復雜的問題,都不太可能建議正確的完整代碼;但是,它通常可以創建一個合理的大綱并節省一些手工輸入。g8728資訊網——每日最新資訊28at.com

還應該注意的是,Copilot是在云端運行的。這意味著它無法脫機工作,自動完成建議也有點慢。此時,您可以通過按Alt+]組合鍵循環瀏覽建議,但有時只有少數幾個建議可供選擇,甚至只有一個建議可供選擇。g8728資訊網——每日最新資訊28at.com

當Copilot運行良好時——實際上已經足夠好了,有點危險。unittest示例中建議的測試和為勾股函數建議的docstring乍一看是正確的,可能會通過疲憊的軟件工程師的審查。但是,當它們包含神秘的錯誤時,這只會導致以后的痛苦!g8728資訊網——每日最新資訊28at.com

綜上所述,雖然Copilot/Codex在目前的狀態下更像是一個玩具或一個學習工具,但令人難以置信的是它居然能工作。如果你遇到一只跳著華爾茲舞的熊,我想令你印象深刻的不會是它跳得如何好。同樣,如果你遇到一個智能代碼完成工具,令你印象深刻的不應是它寫的代碼如何完美。g8728資訊網——每日最新資訊28at.com

總之,隨著自動編程NLP模型技術的進一步發展,以及人類程序員對使用NLP自動完成工具的大量調整,很可能在不久的將來會出現程序合成模型的重大殺手級應用。g8728資訊網——每日最新資訊28at.com

譯者介紹g8728資訊網——每日最新資訊28at.com

朱先忠,51CTO社區編輯,51CTO專家博客、講師,濰坊一所高校計算機教師,自由編程界老兵一枚。早期專注各種微軟技術(編著成ASP.NET AJX、Cocos 2d-X相關三本技術圖書),近十多年投身于開源世界(熟悉流行全棧Web開發技術),了解基于OneNet/AliOS+Arduino/ESP32/樹莓派等物聯網開發技術與Scala+Hadoop+Spark+Flink等大數據開發技術。g8728資訊網——每日最新資訊28at.com

 g8728資訊網——每日最新資訊28at.com

原文標題:NLP Models for Writing Code: Program Synthesis,作者:Kevin Vug8728資訊網——每日最新資訊28at.com

鏈接:https://dzone.com/articles/nlp-models-for-writing-code-program-synthesisg8728資訊網——每日最新資訊28at.com

 g8728資訊網——每日最新資訊28at.com

 g8728資訊網——每日最新資訊28at.com

本文鏈接:http://www.www897cc.com/showinfo-119-2369-0.html自動編程NLP模型技術綜述 譯文

聲明:本網頁內容旨在傳播知識,若有侵權等問題請及時與本網聯系,我們將在第一時間刪除處理。郵件:2376512515@qq.com

上一篇: 阿里云發布云數據中心專用處理器CIPU 替代CPU成為新管控加速中心

下一篇: 云計算企業崛起 甲骨文數據庫市場主導地位動搖

標簽:
  • 熱門焦點
Top 主站蜘蛛池模板: 辽阳县| 岫岩| 华阴市| 神木县| 英超| 界首市| 南昌市| 安徽省| 隆德县| 桂阳县| 九龙城区| 临武县| 文山县| 兴城市| 柳林县| 垦利县| 常州市| 资溪县| 平昌县| 吉隆县| 六枝特区| 屏东县| 夏河县| 林芝县| 台前县| 宣汉县| 威海市| 林西县| 曲麻莱县| 商城县| 嘉荫县| 蒲城县| 信宜市| 黄浦区| 江油市| 河间市| 梧州市| 湟中县| 称多县| 星座| 鄢陵县|