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/
欢迎任何帮助!