微软发布了其最新版本的机器学习框架:ML.NET 0.11带来了新功能和突破性变化。




<https://www.facebook.com/sharer/sharer.php?u=https://entwickler.de/?p=579884864>

<https://twitter.com/home?status=Ich+empfehle+diesen+Artikel%3A+https%3A%2F%2Fentwickler.de%2F%3Fp%3D579884864>
<https://plus.google.com/share?url=https://entwickler.de/?p=579884864>
<https://www.xing.com/spi/shares/new?url=https://entwickler.de/?p=579884864&title=&description=Microsoft+hat+die+neueste+Version+seines+Frameworks+f%C3%BCr+Machine+Learning+ver%C3%B6ffentlicht%3A+ML.NET+0.11+bringt+neue+Features+und+Breaking+Changes+mit.&source=http%3A%2F%2Fentwickler.de>

<http://www.linkedin.com/shareArticle?mini=true&url=https://entwickler.de/?p=579884864&title=&summary=Microsoft+hat+die+neueste+Version+seines+Frameworks+f%C3%BCr+Machine+Learning+ver%C3%B6ffentlicht%3A+ML.NET+0.11+bringt+neue+Features+und+Breaking+Changes+mit.&source=http%3A%2F%2Fentwickler.de>

新版本的机器学习开源框架为TensorFlow和ONNX添加了新功能,但也包括一些重大变化,
这也是发布RC版本之前的最后一个预览版,这个月底将发布0.12版本,也就是RC1。

ML.NET的创新0.11

0.11 版本的ML.NET现在还支持
TensorFlowTransformer组件中的文本输入数据。TensorFlow模型不仅可用于图像,还可用于文本分析。这在.NET博客
<https://devblogs.microsoft.com/dotnet/announcing-ml-net-0-11-machine-learning-for-net/>
的代码示例中进行了说明,该博客
<https://devblogs.microsoft.com/dotnet/announcing-ml-net-0-11-machine-learning-for-net/>
使用TensorFlow模型进行情感分析:



public class TensorFlowSentiment

{

public string Sentiment_Text;

[VectorType(600)]

public int[] Features;

[VectorType(2)]

public float[] Prediction;

}

[TensorFlowFact]

public void TensorFlowSentimentClassificationTest()

{

var mlContext = new MLContext(seed: 1, conc: 1);

var data = new[] { new TensorFlowSentiment() { Sentiment_Text = "this film was
just brilliant casting location scenery story direction everyone's really
suited the part they played and you could just imagine being there robert  is
an amazing actor and now the same being director  father came from the same
scottish island as myself so i loved the fact there was a real connection with
this film the witty remarks throughout the film were great it was just
brilliant so much that i bought the film as soon as it was released for  and
would recommend it to everyone to watch and the fly fishing was amazing really
cried at the end it was so sad and you know what they say if you cry at a film
it must have been good and this definitely was also  to the two little boy's
that played the  of norman and paul they were just brilliant children are often
left out of the  list i think because the stars that play them all grown up are
such a big profile for the whole film but these children are amazing and should
be praised for what they have done don't you think the whole story was so
lovely because it was true and was someone's life after all that was shared
with us all" } };

var dataView = mlContext.Data.ReadFromEnumerable(data);

var lookupMap =
mlContext.Data.ReadFromTextFile(@"sentiment_model/imdb_word_index.csv",

columns: new[]

{

new TextLoader.Column("Words", DataKind.TX, 0),

new TextLoader.Column("Ids", DataKind.I4, 1),

},

separatorChar: ','

);



var estimator = mlContext.Transforms.Text.TokenizeWords("TokenizedWords",
"Sentiment_Text")

.Append(mlContext.Transforms.Conversion.ValueMap(lookupMap, "Words", "Ids",
new[] { ("Features", "TokenizedWords") }));

var dataPipe = estimator.Fit(dataView)

.CreatePredictionEngine<TensorFlowSentiment, TensorFlowSentiment>(mlContext);

string modelLocation = @"sentiment_model";

var tfEnginePipe = mlContext.Transforms.ScoreTensorFlowModel(modelLocation,
new[] { "Prediction/Softmax" }, new[] { "Features" })

.Append(mlContext.Transforms.CopyColumns(("Prediction", "Prediction/Softmax")))

.Fit(dataView)

.CreatePredictionEngine<TensorFlowSentiment, TensorFlowSentiment>(mlContext);

//Predict the sentiment for the sample data

var processedData = dataPipe.Predict(data[0]);

Array.Resize(ref processedData.Features, 600);

var prediction = tfEnginePipe.Predict(processedData);

}

还为MLContext目录添加了其他机器学习组件。这应该可以更容易地找到类和操作。该图显示了基于智能提示的用户体验。

<https://entwickler.de/wp-content/uploads/2019/03/mlContext2.png>

该ONNX组件还进行了重构:Microsoft.ML.ONNX  更改为 Microsoft.ML.ONNXConverter 和
Microsoft.ML.ONNXTrans .FORM更改为Microsoft.ML.ONNXTransformer
。这更清晰的表达ONNX转换和转换之间的区别。ONNX是一种开放且可互操作的模型格式,允许您在框架中训练模型,以及在另一个框架中使用。例如:Scikit-learn
或TensorFlow 训练的模型放到 在ML.NET中使用。

与之前版本的ML.NET 0.10相比,ML.NET 0.11包含一些重大更改,包括删除Microsoft.ML.Core命名空间。破坏性性更改
<https://github.com/dotnet/machinelearning-samples/blob/master/docs/migrations/breaking-changes-0.11.md>
列表已发布在GitHub上。有关ML.NET 0.11中的新功能的更详细信息参见.NET博客文章:
<https://devblogs.microsoft.com/dotnet/announcing-ml-net-0-11-machine-learning-for-net/>
https://devblogs.microsoft.com/dotnet/announcing-ml-net-0-11-machine-learning-for-net/

<https://devblogs.microsoft.com/dotnet/announcing-ml-net-0-11-machine-learning-for-net/>

友情链接
KaDraw流程图
API参考文档
OK工具箱
云服务器优惠
阿里云优惠券
腾讯云优惠券
华为云优惠券
站点信息
问题反馈
邮箱:ixiaoyang8@qq.com
QQ群:637538335
关注微信