SiaNet
1.0.0
Trello 用於追蹤 SiaNet 開發活動。歡迎您觀看任何任務並追蹤進度。建議將被列入願望清單,然後計劃進行開發
https://trello.com/b/bLbgQLgy/sianet-development
開發 C# 包裝器以幫助開發人員輕鬆創建和訓練深度神經網路模型。
下面是泰坦尼克號資料集的分類範例。能夠在 10 個 epoch 內達到 75% 的準確率。
//Setup Engine. If using TensorSharp then pass SiaNet.Backend.TensorSharp.SiaNetBackend.Instance.
//Once other backend is ready you will be able to use CNTK, TensorFlow and MxNet as well.
Global . UseEngine ( SiaNet . Backend . ArrayFire . SiaNetBackend . Instance , DeviceType . CPU ) ;
var dataset = LoadTrain ( ) ; //Load train data
var test = LoadTest ( ) ; //Load test data
var ( train , val ) = dataset . Split ( 0.25 ) ;
//Build model
var model = new Sequential ( ) ;
model . EpochEnd += Model_EpochEnd ;
model . Add ( new Dense ( 128 , ActivationType . ReLU ) ) ;
model . Add ( new Dense ( 64 , ActivationType . ReLU ) ) ;
model . Add ( new Dense ( 1 , ActivationType . Sigmoid ) ) ;
//Compile with Optimizer, Loss and Metric
model . Compile ( OptimizerType . Adam , LossType . BinaryCrossEntropy , MetricType . BinaryAccurary ) ;
// Train for 100 epoch with batch size of 32
model . Train ( train , 100 , 32 , val ) ;
var predictions = model . Predict ( test ) ;
predictions . Print ( ) ;
完整程式碼:https://github.com/SciSharp/SiaNet/blob/master/Examples/BasicClassificationWithTitanicDataset/Program.cs
更多範例:https://github.com/SciSharp/SiaNet/blob/master/Examples
https://scisharp.github.io/SiaNet/
歡迎任何幫助!