问题标签 [infer.net]
For questions regarding programming in ECMAScript (JavaScript/JS) and its various dialects/implementations (excluding ActionScript). Note JavaScript is NOT the same as Java! Please include all relevant tags on your question; e.g., [node.js], [jquery], [json], [reactjs], [angular], [ember.js], [vue.js], [typescript], [svelte], etc.
.net - 如何获取变量的值在 Infer.Net 中?
我有一个这样定义的双变量:
现在我想在命令行上打印该值,但我找不到如何做到这一点。
我试图打印它,但什么也没打印:
这是完整的示例代码:
infer.net - GaussianProductOp.ProductAverageConditional - has quality band Experimental which is less than the recommended quality band (Preview)
I have a quite simple rule and I get already the quality band issue. Can someone explain why this is happening? I have read the docs about Quality bands but I don't understand it.
This is the code I wrote that produces the warning:
the warning is:
c# - 如何将 Infer.NET 安装到 Unity 2018.3
我有一个新的 Unity 项目,并按照在 Unity 中使用 .NET 4.x 中的说明,我从库中下载了 Microsoft.ML.Probabilistic.Compiler NuGet 包并将 DLL 复制到资产/插件。在此 Unity 输出错误消息后
由于错误,将不会加载程序集“Assets/Plugins/Microsoft.ML.Probabilistic.Compiler.dll”:无法解析引用“Microsoft.ML.Probabilistic”。程序集是否丢失或与当前平台不兼容?
我下载并复制了丢失的 DLL 以及以下所有丢失的 DLL 依赖项
- Microsoft.ML.Probabilistic.dll
- System.CodeDom.dll
- Microsoft.CodeAnalysis.CSharp.dll
- Microsoft.CodeAnalysis.dll
- System.Collections.Immutable.dll
- System.Reflection.Metadata.dll
添加 System.Reflection.Metadata.dll 后,Unity 不再显示错误。
当我添加
对于脚本,该项目在 Unity 和 Visual Studio 社区中构建良好,但是当我尝试使用库时,即Microsoft.ML.Probabilistic.Compiler.Variable<T>
类
Unity 和 Visual Studio 都失败了
Assets/Scripts/Main.cs(7,3):错误 CS0246:找不到类型或命名空间名称“Variable<>”(您是否缺少 using 指令或程序集引用?)
和
Assets/Scripts/Main.cs(7,30):错误 CS0103:当前上下文中不存在名称“变量”
添加-r:Microsoft.ML.Probabilistic.Compiler.dll
到 Assets/mcs.rsp 文件会产生错误
Microsoft (R) Visual C# 编译器版本 2.9.1.65535 (9d34608e) 版权所有 (C) Microsoft Corporation。版权所有。
错误 CS0006:找不到元数据文件“Microsoft.ML.Probabilistic.Compiler.dll”
项目配置为
- 统一2018.3.10f1
- Visual Studio for Mac 社区
- 构建设置/平台:iOS
- 播放器设置/脚本运行时版本:.NET 4.x 等效
我是否设置没有区别
- 播放器设置/Api 兼容级别:.NET 4.x
或者
- 播放器设置/Api 兼容级别:.NET Standard 2.0
其他设置保留为默认值。
正如指南所说,我没有将 DLL 添加到 Visual Studio 中的 vs-project
每次打开 Unity 项目时,Visual Studio 都会为它们重新生成 .csproj 和 .sln 文件。因此,您不能直接在 Visual Studio 中添加程序集引用,因为它们会在重新打开项目时丢失。相反,必须使用名为 mcs.rsp 的特殊文本文件:
在 Unity 项目的根 Assets 目录中创建一个名为 mcs.rsp 的新文本文件。
在空文本文件的第一行,输入:-r:System.Net.Http.dll 然后保存文件。您可以将“System.Net.Http.dll”替换为任何可能缺少引用的包含程序集。
重新启动 Unity 编辑器。
python - 如何处理 infer.net 和 pythonnet?
我正在尝试在 Python 3.6中使用 infer.net ( https://dotnet.github.io/infer/ )。为此,我安装了 pythonnet 包,并下载了我需要使用 infer.net 的 dll 文件。文件/包的导入,新类型的使用正在工作,但是当我试图推断一个基本模型时,我得到了一个 PlatformNotSupportedException 并且我不知道如何处理这种错误。有人可以帮助我吗?我在这里使用 Jupyter Notebook 这是我使用的代码。
python - 使用 Python.NET 将 .NET 类型 (System.Converter) 转换为 Python 类型
我正在尝试编写与此 C# 代码等效的 Python.NET :
但是,该Util.ArrayInit()
方法接受一个int
和一个Converter<TInput,TOutput> Delegate --- 我不知道 Python 的等价物是什么。我尝试了一个 lambda,但它没有用:
问题 1:如何从 Python 调试器/控制台检查哪些参数确实具有匹配方法?(也许不可能。)
问题 2:我是否需要创建一个从 Python (例如 lambda)编组到 .NET 的自定义对象,Python自动转换为 .NET的方式......或者有更简单的方法吗?function
System.Converter
int
System.Int32
我Util.ArrayInit
首先通过不使用来规避了这一点,但我仍然对这样做的情况感到好奇,这样做并不是那么微不足道。