如果您喜歡該項目,請★明星此存儲庫以表示支持! ?
2024年1月15日 - 當我反思Spago的旅程時,我對它為我提供的豐富經歷感到非常感激。通過Spago進行深入學習的基礎,掌握GO並重新審視了巨大的回報。 Spago的獨特功能,尤其是其異步計算圖並專注於清潔編碼,使其成為一個非凡的項目。我們的目標是在GO中創建一個極簡主義的ML框架,從而通過啟用獨立可執行文件來消除對生產中對Python的依賴。 Spago的這種方法成功地在挑戰性的生產環境中為我的幾個項目提供了動力。
但是,將Spago提升到可以在不斷發展的“ AI空間”中有效競爭的水平,該水平現在廣泛涉及GPU上的計算,這需要實質性的承諾。同時,Spago渴望實現的願景現在被Rust的蠟燭項目令人印象深刻。由於我將必要的關注能力有限,並且在沒有支撐維護團隊的情況下,我做出了務實的決定來暫停該項目。
我非常感謝Spago帶我去的旅程和支持它的社區。隨著我們繼續探索不斷發展的機器學習領域,我期待著令人興奮的發展。
溫暖的問候,
Matteo Grella
Spago是一個用Pure Go編寫的機器學習庫,旨在支持自然語言處理中的相關神經體系結構。
Spago是獨立的,因為它使用自己的輕量級計算圖進行訓練和推理,從頭到尾都易於理解。
它提供:
如果您對NLP相關的功能感興趣,請務必探索塞伯倫包裝!
要求:
克隆此存儲庫或獲取圖書館:
go get -u github.com/nlpodyssey/spago一個好的起點是查看內置神經模型(例如LSTM)的實現。
這是如何計算兩個變量總和的示例:
package main
import (
"fmt"
"log"
"github.com/nlpodyssey/spago/ag"
"github.com/nlpodyssey/spago/mat"
)
func main () {
// define the type of the elements in the tensors
type T = float32
// create a new node of type variable with a scalar
a := mat . Scalar ( T ( 2.0 ), mat . WithGrad ( true )) // create another node of type variable with a scalar
b := mat . Scalar ( T ( 5.0 ), mat . WithGrad ( true )) // create an addition operator (the calculation is actually performed here)
c := ag . Add ( a , b )
// print the result
fmt . Printf ( "c = %v (float%d) n " , c . Value (), c . Value (). Item (). BitSize ())
c . AccGrad ( mat . Scalar ( T ( 0.5 )))
if err := ag . Backward ( c ); err != nil {
log . Fatalf ( "error during Backward(): %v" , err )
}
fmt . Printf ( "ga = %v n " , a . Grad ())
fmt . Printf ( "gb = %v n " , b . Grad ())
}輸出:
c = [7] (float32)
ga = [0.5]
gb = [0.5]這是感知公式的簡單實現:
package main
import (
"fmt"
. "github.com/nlpodyssey/spago/ag"
"github.com/nlpodyssey/spago/mat"
)
func main () {
x := mat . Scalar ( - 0.8 )
w := mat . Scalar ( 0.4 )
b := mat . Scalar ( - 0.2 )
y := Sigmoid ( Add ( Mul ( w , x ), b ))
fmt . Printf ( "y = %0.3f n " , y . Value (). Item ())
}如果您認為缺少某些東西或可能會得到改善,請打開問題並提取請求。
要開始貢獻,請檢查貢獻指南。
我們強烈鼓勵您創建一個問題,因為它將有助於社區的發展。但是,如果您想私下與我們溝通,請隨時向Matteo Grella發送任何問題或評論。