ML.NET 发布0.11版本:.NET中的机器学习,为TensorFlow和ONNX添加了新功能
微软发布了其最新版本的机器学习框架:ML.NET 0.11带来了新功能和突破性变化。
新版本的机器学习开源框架为TensorFlow和ONNX添加了新功能,但也包括一些重大变化, 这也是发布RC版本之前的最后一个预览版,这个月底将发布0.12版本,也就是RC1。
ML.NET的创新0.11
0.11 版本的ML.NET现在还支持 TensorFlowTransformer组件中的文本输入数据。TensorFlow模型不仅可用于图像,还可用于文本分析。这在.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目录添加了其他机器学习组件。这应该可以更容易地找到类和操作。该图显示了基于智能提示的用户体验。
该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命名空间。破坏性性更改 列表已发布在GitHub上。有关ML.NET 0.11中的新功能的更详细信息参见 .NET博客文章:https://devblogs.microsoft.com/dotnet/announcing-ml-net-0-11-machine-learning-for-net/ 。
ML.NET 发布0.11版本:.NET中的机器学习,为TensorFlow和ONNX添加了新功能的更多相关文章
- (数据科学学习手札139)geopandas 0.11版本重要新特性一览
本文示例代码已上传至我的Github仓库https://github.com/CNFeffery/DataScienceStudyNotes 1 简介 大家好我是费老师,就在几天前,geopandas ...
- [转载]Linux 环境下编译 0.11版本内核 kernel
最近在看<.如果Clobber/Modify 为空,则其前面的冒号(:)必须省略. 2.如果Output,Input,Clobber/Modify都为空,Output,Input之前的冒号(:) ...
- Apache Kafka 0.11版本新功能简介
Apache Kafka近日推出0.11版本.这是一个里程碑式的大版本,特别是Kafka从这个版本开始支持“exactly-once”语义(下称EOS, exactly-once semantics) ...
- <摘录>Linux 环境下编译 0.11版本内核 kernel
系统环境:Fedora 13 + gcc-4.4.5 最近在看<linux内核0.11完全注释>一书,由于书中涉及汇编语言的地方众多,本人在大学时汇编语言学得一塌糊涂,所以实在看不下去了, ...
- SpringMVC+MyBatis+Druid使用MySQL8.0.11版本
1.使用MySQL8.0.11版本,要使用5.1.45或其他高版本驱动jar包,我本地使用的是最新的8.0.11 2.更换了MySQL驱动后,报Cannot find class [com.aliba ...
- 深度学习库 SynapseML for .NET 发布0.1 版本
2021年11月 微软开源一款简单的.多语言的.大规模并行的机器学习库 SynapseML(以前称为 MMLSpark),以帮助开发人员简化机器学习管道的创建.具体参见[1]微软深度学习库 Synap ...
- windows一机多装mysql,5.5+版本,8.0.11版本
00.安装第一个mysql,压缩版或者安装版,过程省略,目录如下: 运行中输入“regedit” 进入后,找到 HKEY_LOCAL_MACHINE\SYSTEM\CurrentCont ...
- Kafka 0.11版本新功能介绍 —— 空消费组延时rebalance
在0.11之前的版本中,多个consumer实例加入到一个空消费组将导致多次的rebalance,这是由于每个consumer instance启动的时间不可控,很有可能超出coordinator确定 ...
- java连接mysql数据库8.0以上版本过程中遇到的坑
来自:https://blog.csdn.net/u013276277/article/details/80255468 首先,我居然不能用navicat客户端连接上mysql8.0数据库报1251错 ...
随机推荐
- 解决Kali用户名密码正确但是无法登陆的问题
本文由荒原之梦原创,原文链接:http://zhaokaifeng.com/?p=684 前言: 用户名和密码都正确,但是登陆Kali的时候总是提示用户名或密码错误,无法登陆,本文介绍一种解决办法. ...
- Navicat PatchNavicat
Navicat for MySQL 11.0.10 32+64位(内含破解补丁)\64位 安装完成后,退出Navicat 执行PatchNavicat.exe,提示patch完成后,Navicat即可 ...
- SSH概念及常用操作汇总
工作有一段时间了,经常用SSH登录远程机器,但对原理一直不是很了解,所以查阅了一些资料,写个小结. 一. SSH是什么? SSH的全称是Secure Shell, 是一种“用来在不安全的网络上安全地运 ...
- 数据库历险记(一) | MySQL这么好,为什么还有人用Oracle?
关系型数据库(Relational DataBase Management System),简称 RDBMS.说起关系型数据库,我们脑海中会立即浮现出 Oracle.MySQL.SQLServer 等 ...
- js文件引用的问题顺带复习css引用
js文件包含在<script>块中用scr引用,css在link和@import来引用,css不是本篇的重点,直接引用一个博主的总结: “ 区别1:link是XHTML标签,除了加载CSS ...
- Nginx重新编译添加新模块
找到nginx的安装包目录,如果没有的话去官网重新下载 查看ngixn版本极其编译参数 /usr/local/nginx/sbin/nginx -V 进入nginx源码目录,重新设置nginx ./c ...
- linux系统日志查看
系统 日志文件( 可以通过cat 或tail 命令来查看) /var/log/message 系统启动后的信息和错误日志,是Red Hat Linux中最常用的日志之一/var/log/secure ...
- Tensorflow源码解析1 -- 内核架构和源码结构
1 主流深度学习框架对比 当今的软件开发基本都是分层化和模块化的,应用层开发会基于框架层.比如开发Linux Driver会基于Linux kernel,开发Android app会基于Android ...
- 新手教程:不写JS,在MIP页中实现异步加载数据
从需求谈起:在 MIP 页中异步加载数据 MIP(移动网页加速器) 的 加速原理 除了靠谱的 MIP-Cache CDN 加速外,最值得一提的就是组件系统.所有 JS 交互都需要使用 MIP 组件实现 ...
- Navicat:实现两个数据库结构同步和数据库对比
Navicat版本:Navicat Premium 12 选择 工具 ——> 结构同步 选择源数据库和目标数据库,选择完成后点击右下角对比按钮 要修改的对象:源数据库和目标数据库中都有的 ...