зеркало из https://github.com/dotnet/infer.git
Fixed IronPython examples (#5)
* IronPython examples now work. * Removed an obsolete path from TestWrapper.pyproj
This commit is contained in:
Родитель
9a9f142737
Коммит
04c2de019f
|
@ -259,4 +259,7 @@ apiguide-tmp/
|
|||
_site/
|
||||
|
||||
#code generated by iron python examples
|
||||
IronPythonWrapper/InferNetExamples/InferNetExamples/GeneratedSource/
|
||||
src/IronPythonWrapper/InferNetExamples/InferNetExamples/GeneratedSource/
|
||||
|
||||
#Compiler for IronPython
|
||||
src/IronPythonWrapper/Compiler
|
|
@ -29,6 +29,6 @@ def gaussian_ranges():
|
|||
x.ObservedValue = data
|
||||
|
||||
# The inference
|
||||
ie = InferenceEngine(VariationalMessagePassing())
|
||||
ie = InferenceEngine(Algorithms.VariationalMessagePassing())
|
||||
print "mean = ", ie.Infer(mean)
|
||||
print "prec = ", ie.Infer(precision)
|
|
@ -6,7 +6,7 @@
|
|||
<ProjectGuid>{44d352de-299b-4409-9371-949ac48b4225}</ProjectGuid>
|
||||
<ProjectHome>.</ProjectHome>
|
||||
<StartupFile>InferNetExamples.py</StartupFile>
|
||||
<SearchPath>..\..\..\Compiler\bin\Release</SearchPath>
|
||||
<SearchPath>..\..\Compiler</SearchPath>
|
||||
<WorkingDirectory>.</WorkingDirectory>
|
||||
<InterpreterId>IronPython|2.7-32</InterpreterId>
|
||||
<LaunchProvider>IronPython (.NET) launcher</LaunchProvider>
|
||||
|
@ -17,6 +17,7 @@
|
|||
<SccProvider>SAK</SccProvider>
|
||||
<SccAuxPath>SAK</SccAuxPath>
|
||||
<SccLocalPath>SAK</SccLocalPath>
|
||||
<DebugStdLib>False</DebugStdLib>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition=" '$(Configuration)' == 'Debug' ">
|
||||
<DebugSymbols>true</DebugSymbols>
|
||||
|
|
|
@ -20,6 +20,7 @@ import Microsoft.ML.Probabilistic.Distributions
|
|||
import Microsoft.ML.Probabilistic.Collections
|
||||
import Microsoft.ML.Probabilistic.Factors
|
||||
import Microsoft.ML.Probabilistic.Math
|
||||
import Microsoft.ML.Probabilistic.Algorithms
|
||||
from Microsoft.ML.Probabilistic import *
|
||||
|
||||
#---------import all classes and methods from above namespaces-----------
|
||||
|
@ -28,6 +29,9 @@ from Microsoft.ML.Probabilistic.Models import *
|
|||
from Microsoft.ML.Probabilistic.Collections import *
|
||||
from Microsoft.ML.Probabilistic.Factors import *
|
||||
from Microsoft.ML.Probabilistic.Math import *
|
||||
from Microsoft.ML.Probabilistic.Algorithms import *
|
||||
|
||||
InferenceEngine.DefaultEngine.Compiler.CompilerChoice = Microsoft.ML.Probabilistic.Compiler.CompilerChoice.Roslyn
|
||||
|
||||
#----------------------------------------------------------------------------
|
||||
#---------------- Variable array helper methos ---------------------------
|
||||
|
|
|
@ -4,6 +4,6 @@ Make sure folders containing `InferNetWrapper.py` and Infer.NET binaries are pre
|
|||
|
||||
# Running Tests and Examples
|
||||
|
||||
* Build `Infer2.sln` using the `Release` configuration, so that Infer.NET binaries will become present in `/Compiler/bin/Release` folder.
|
||||
* Open `TestWrapper.sln` for tests or `InferNerExamples.sln` for examples.
|
||||
* Run `SetupCompiler.cmd` script. It runs `dotnet publish` on `Compiler.csproj` and puts the results into `src/IronPythonWrapper/Compiler` folder.
|
||||
* Open `TestWrapper.sln` for tests or `InferNetExamples.sln` for examples.
|
||||
* Run the only project in the opened solution.
|
|
@ -0,0 +1 @@
|
|||
dotnet publish -c ReleaseCore -o ../IronPythonWrapper/Compiler ../Compiler/Compiler.csproj
|
|
@ -6,7 +6,7 @@
|
|||
<ProjectGuid>{9234127e-fbc0-4587-bad9-65727458cc0f}</ProjectGuid>
|
||||
<ProjectHome>.</ProjectHome>
|
||||
<StartupFile>TestWrapper.py</StartupFile>
|
||||
<SearchPath>..\..\..\Compiler\bin\Release\;..\..\InferNetExamples\InferNetExamples</SearchPath>
|
||||
<SearchPath>..\..\InferNetExamples\InferNetExamples;..\..\Compiler</SearchPath>
|
||||
<WorkingDirectory>.</WorkingDirectory>
|
||||
<InterpreterId>IronPython|2.7-32</InterpreterId>
|
||||
<LaunchProvider>IronPython (.NET) launcher</LaunchProvider>
|
||||
|
|
Загрузка…
Ссылка в новой задаче