This repository has been archived by the owner on Nov 19, 2020. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 2k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Adding a separate application to provide benchmarks between the curre…
…nt implementation and previous versions of the framework.
- Loading branch information
1 parent
4bc2745
commit 347dd92
Showing
242 changed files
with
542,532 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,37 @@ | ||
|
||
Microsoft Visual Studio Solution File, Format Version 12.00 | ||
# Visual Studio 2013 | ||
VisualStudioVersion = 12.0.40629.0 | ||
MinimumVisualStudioVersion = 10.0.40219.1 | ||
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "CurrentVersion", "CurrentVersion\CurrentVersion.csproj", "{7921C2EA-3634-4C33-BB10-B4F960EEDD97}" | ||
ProjectSection(ProjectDependencies) = postProject | ||
{1390F440-FFFA-45F3-A920-07FD4EEC8785} = {1390F440-FFFA-45F3-A920-07FD4EEC8785} | ||
EndProjectSection | ||
EndProject | ||
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "PreviousVersion", "PreviousVersion\PreviousVersion.csproj", "{18B60F92-5DB1-495A-947D-80F60F6B0661}" | ||
EndProject | ||
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Shared", "Shared\Shared.csproj", "{1390F440-FFFA-45F3-A920-07FD4EEC8785}" | ||
EndProject | ||
Global | ||
GlobalSection(SolutionConfigurationPlatforms) = preSolution | ||
Debug|Any CPU = Debug|Any CPU | ||
Release|Any CPU = Release|Any CPU | ||
EndGlobalSection | ||
GlobalSection(ProjectConfigurationPlatforms) = postSolution | ||
{7921C2EA-3634-4C33-BB10-B4F960EEDD97}.Debug|Any CPU.ActiveCfg = Debug|Any CPU | ||
{7921C2EA-3634-4C33-BB10-B4F960EEDD97}.Debug|Any CPU.Build.0 = Debug|Any CPU | ||
{7921C2EA-3634-4C33-BB10-B4F960EEDD97}.Release|Any CPU.ActiveCfg = Release|Any CPU | ||
{7921C2EA-3634-4C33-BB10-B4F960EEDD97}.Release|Any CPU.Build.0 = Release|Any CPU | ||
{18B60F92-5DB1-495A-947D-80F60F6B0661}.Debug|Any CPU.ActiveCfg = Debug|Any CPU | ||
{18B60F92-5DB1-495A-947D-80F60F6B0661}.Debug|Any CPU.Build.0 = Debug|Any CPU | ||
{18B60F92-5DB1-495A-947D-80F60F6B0661}.Release|Any CPU.ActiveCfg = Release|Any CPU | ||
{18B60F92-5DB1-495A-947D-80F60F6B0661}.Release|Any CPU.Build.0 = Release|Any CPU | ||
{1390F440-FFFA-45F3-A920-07FD4EEC8785}.Debug|Any CPU.ActiveCfg = Debug|Any CPU | ||
{1390F440-FFFA-45F3-A920-07FD4EEC8785}.Debug|Any CPU.Build.0 = Debug|Any CPU | ||
{1390F440-FFFA-45F3-A920-07FD4EEC8785}.Release|Any CPU.ActiveCfg = Release|Any CPU | ||
{1390F440-FFFA-45F3-A920-07FD4EEC8785}.Release|Any CPU.Build.0 = Release|Any CPU | ||
EndGlobalSection | ||
GlobalSection(SolutionProperties) = preSolution | ||
HideSolutionNode = FALSE | ||
EndGlobalSection | ||
EndGlobal |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
<?xml version="1.0" encoding="utf-8"?> | ||
<configuration> | ||
<startup> | ||
<supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.5" /> | ||
</startup> | ||
<runtime> | ||
<assemblyBinding xmlns="urn:schemas-microsoft-com:asm.v1"> | ||
<dependentAssembly> | ||
<assemblyIdentity name="Accord.Audio" publicKeyToken="fa1a88e29555ccf7" culture="neutral" /> | ||
<bindingRedirect oldVersion="0.0.0.0-3.0.2.0" newVersion="3.0.2.0" /> | ||
</dependentAssembly> | ||
</assemblyBinding> | ||
</runtime> | ||
</configuration> |
153 changes: 153 additions & 0 deletions
153
Tools/Performance/Comparer/CurrentVersion/CurrentVersion.csproj
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,153 @@ | ||
<?xml version="1.0" encoding="utf-8"?> | ||
<Project ToolsVersion="12.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003"> | ||
<Import Project="$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props" Condition="Exists('$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props')" /> | ||
<PropertyGroup> | ||
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration> | ||
<Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform> | ||
<ProjectGuid>{7921C2EA-3634-4C33-BB10-B4F960EEDD97}</ProjectGuid> | ||
<OutputType>Exe</OutputType> | ||
<AppDesignerFolder>Properties</AppDesignerFolder> | ||
<RootNamespace>CurrentVersion</RootNamespace> | ||
<AssemblyName>CurrentVersion</AssemblyName> | ||
<TargetFrameworkVersion>v4.5</TargetFrameworkVersion> | ||
<FileAlignment>512</FileAlignment> | ||
</PropertyGroup> | ||
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' "> | ||
<PlatformTarget>AnyCPU</PlatformTarget> | ||
<DebugSymbols>true</DebugSymbols> | ||
<DebugType>full</DebugType> | ||
<Optimize>false</Optimize> | ||
<OutputPath>bin\Debug\</OutputPath> | ||
<DefineConstants>DEBUG;TRACE</DefineConstants> | ||
<ErrorReport>prompt</ErrorReport> | ||
<WarningLevel>4</WarningLevel> | ||
</PropertyGroup> | ||
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' "> | ||
<PlatformTarget>AnyCPU</PlatformTarget> | ||
<DebugType>pdbonly</DebugType> | ||
<Optimize>true</Optimize> | ||
<OutputPath>bin\Release\</OutputPath> | ||
<DefineConstants>TRACE</DefineConstants> | ||
<ErrorReport>prompt</ErrorReport> | ||
<WarningLevel>4</WarningLevel> | ||
</PropertyGroup> | ||
<ItemGroup> | ||
<Reference Include="Accord"> | ||
<HintPath>..\..\..\..\Release\net45\Accord.dll</HintPath> | ||
</Reference> | ||
<Reference Include="Accord.Audio"> | ||
<HintPath>..\..\..\..\Release\net45\Accord.Audio.dll</HintPath> | ||
</Reference> | ||
<Reference Include="Accord.Audio.DirectSound"> | ||
<HintPath>..\..\..\..\Release\net45\Accord.Audio.DirectSound.dll</HintPath> | ||
</Reference> | ||
<Reference Include="Accord.Audio.Formats"> | ||
<HintPath>..\..\..\..\Release\net45\Accord.Audio.Formats.dll</HintPath> | ||
</Reference> | ||
<Reference Include="Accord.Audition"> | ||
<HintPath>..\..\..\..\Release\net45\Accord.Audition.dll</HintPath> | ||
</Reference> | ||
<Reference Include="Accord.Controls"> | ||
<HintPath>..\..\..\..\Release\net45\Accord.Controls.dll</HintPath> | ||
</Reference> | ||
<Reference Include="Accord.Controls.Audio"> | ||
<HintPath>..\..\..\..\Release\net45\Accord.Controls.Audio.dll</HintPath> | ||
</Reference> | ||
<Reference Include="Accord.Controls.Imaging"> | ||
<HintPath>..\..\..\..\Release\net45\Accord.Controls.Imaging.dll</HintPath> | ||
</Reference> | ||
<Reference Include="Accord.Controls.Vision"> | ||
<HintPath>..\..\..\..\Release\net45\Accord.Controls.Vision.dll</HintPath> | ||
</Reference> | ||
<Reference Include="Accord.Fuzzy"> | ||
<HintPath>..\..\..\..\Release\net45\Accord.Fuzzy.dll</HintPath> | ||
</Reference> | ||
<Reference Include="Accord.Genetic"> | ||
<HintPath>..\..\..\..\Release\net45\Accord.Genetic.dll</HintPath> | ||
</Reference> | ||
<Reference Include="Accord.Imaging"> | ||
<HintPath>..\..\..\..\Release\net45\Accord.Imaging.dll</HintPath> | ||
</Reference> | ||
<Reference Include="Accord.IO"> | ||
<HintPath>..\..\..\..\Release\net45\Accord.IO.dll</HintPath> | ||
</Reference> | ||
<Reference Include="Accord.MachineLearning"> | ||
<HintPath>..\..\..\..\Release\net45\Accord.MachineLearning.dll</HintPath> | ||
</Reference> | ||
<Reference Include="Accord.MachineLearning.GPL"> | ||
<HintPath>..\..\..\..\Release\net45\GPL\Accord.MachineLearning.GPL.dll</HintPath> | ||
</Reference> | ||
<Reference Include="Accord.Math"> | ||
<HintPath>..\..\..\..\Release\net45\Accord.Math.dll</HintPath> | ||
</Reference> | ||
<Reference Include="Accord.Math.Noncommercial"> | ||
<HintPath>..\..\..\..\Release\net45\Noncommercial\Accord.Math.Noncommercial.dll</HintPath> | ||
</Reference> | ||
<Reference Include="Accord.Neuro"> | ||
<HintPath>..\..\..\..\Release\net45\Accord.Neuro.dll</HintPath> | ||
</Reference> | ||
<Reference Include="Accord.Statistics"> | ||
<HintPath>..\..\..\..\Release\net45\Accord.Statistics.dll</HintPath> | ||
</Reference> | ||
<Reference Include="Accord.Video"> | ||
<HintPath>..\..\..\..\Release\net45\Accord.Video.dll</HintPath> | ||
</Reference> | ||
<Reference Include="Accord.Video.DirectShow"> | ||
<HintPath>..\..\..\..\Release\net45\Accord.Video.DirectShow.dll</HintPath> | ||
</Reference> | ||
<Reference Include="Accord.Video.Kinect"> | ||
<HintPath>..\..\..\..\Release\net45\Accord.Video.Kinect.dll</HintPath> | ||
</Reference> | ||
<Reference Include="Accord.Video.VFW"> | ||
<HintPath>..\..\..\..\Release\net45\Accord.Video.VFW.dll</HintPath> | ||
</Reference> | ||
<Reference Include="Accord.Video.Ximea"> | ||
<HintPath>..\..\..\..\Release\net45\Accord.Video.Ximea.dll</HintPath> | ||
</Reference> | ||
<Reference Include="Accord.Vision"> | ||
<HintPath>..\..\..\..\Release\net45\Accord.Vision.dll</HintPath> | ||
</Reference> | ||
<Reference Include="BenchmarkDotNet, Version=0.9.4.0, Culture=neutral, processorArchitecture=MSIL"> | ||
<HintPath>..\packages\BenchmarkDotNet.0.9.4\lib\net45\BenchmarkDotNet.dll</HintPath> | ||
<Private>True</Private> | ||
</Reference> | ||
<Reference Include="Microsoft.Build" /> | ||
<Reference Include="Microsoft.Build.Framework" /> | ||
<Reference Include="Microsoft.Build.Utilities.v12.0, Version=12.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a, processorArchitecture=MSIL" /> | ||
<Reference Include="System" /> | ||
<Reference Include="System.Core" /> | ||
<Reference Include="System.Management" /> | ||
<Reference Include="System.Xml.Linq" /> | ||
<Reference Include="System.Data.DataSetExtensions" /> | ||
<Reference Include="Microsoft.CSharp" /> | ||
<Reference Include="System.Data" /> | ||
<Reference Include="System.Xml" /> | ||
<Reference Include="ZedGraph"> | ||
<HintPath>..\..\..\..\Release\net45\ZedGraph.dll</HintPath> | ||
</Reference> | ||
</ItemGroup> | ||
<ItemGroup> | ||
<Compile Include="MulticlassSupportVectorMachineTest.cs" /> | ||
<Compile Include="KernelSupportVectorMachineTest.cs" /> | ||
<Compile Include="Program.cs" /> | ||
<Compile Include="Properties\AssemblyInfo.cs" /> | ||
</ItemGroup> | ||
<ItemGroup> | ||
<None Include="App.config" /> | ||
<None Include="packages.config" /> | ||
</ItemGroup> | ||
<ItemGroup> | ||
<ProjectReference Include="..\Shared\Shared.csproj"> | ||
<Project>{1390f440-fffa-45f3-a920-07fd4eec8785}</Project> | ||
<Name>Shared</Name> | ||
</ProjectReference> | ||
</ItemGroup> | ||
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" /> | ||
<!-- To modify your build process, add your task inside one of the targets below and uncomment it. | ||
Other similar extension points exist, see Microsoft.Common.targets. | ||
<Target Name="BeforeBuild"> | ||
</Target> | ||
<Target Name="AfterBuild"> | ||
</Target> | ||
--> | ||
</Project> |
72 changes: 72 additions & 0 deletions
72
Tools/Performance/Comparer/CurrentVersion/KernelSupportVectorMachineTest.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,72 @@ | ||
using Accord.MachineLearning.VectorMachines; | ||
using Accord.MachineLearning.VectorMachines.Learning; | ||
using Accord.Statistics.Kernels; | ||
using BenchmarkDotNet.Attributes; | ||
using System.Text; | ||
using System.Threading.Tasks; | ||
using Accord.Math; | ||
using Accord.Math.Distances; | ||
using Accord.Statistics.Distributions.Univariate; | ||
using Accord; | ||
using Shared; | ||
|
||
namespace CurrentVersion | ||
{ | ||
[Config(typeof(FastAndDirtyConfig))] | ||
public class KernelSupportVectorMachineTest | ||
{ | ||
private readonly double[][] inputs; | ||
private readonly int[] outputs; | ||
|
||
SupportVectorMachine<Polynomial> ksvm; | ||
SequentialMinimalOptimization<Polynomial> smo; | ||
|
||
public KernelSupportVectorMachineTest() | ||
{ | ||
var data = Shared.Examples.YinYang(); | ||
inputs = data.Training.Inputs; | ||
outputs = data.Training.Output; | ||
} | ||
|
||
[Setup] | ||
public void Setup() | ||
{ | ||
ksvm = new SupportVectorMachine<Polynomial>(inputs: 2, kernel: new Polynomial(2)); | ||
smo = new SequentialMinimalOptimization<Polynomial>() | ||
{ | ||
Model = ksvm | ||
}; | ||
} | ||
|
||
[Benchmark] | ||
public IntRange Accord_Core() | ||
{ | ||
return new IntRange(0, 1); | ||
} | ||
|
||
[Benchmark] | ||
public Cosine Accord_Math() | ||
{ | ||
return new Cosine(); | ||
} | ||
|
||
[Benchmark] | ||
public NormalDistribution Accord_Statistics() | ||
{ | ||
return new NormalDistribution(); | ||
} | ||
|
||
[Benchmark] | ||
public SupportVectorMachine<Polynomial> v3_1_0() | ||
{ | ||
ksvm = new SupportVectorMachine<Polynomial>(inputs: 2, kernel: new Polynomial(2)); | ||
smo = new SequentialMinimalOptimization<Polynomial>() | ||
{ | ||
Model = ksvm | ||
}; | ||
smo.Learn(inputs, outputs); | ||
return ksvm; | ||
} | ||
|
||
} | ||
} |
74 changes: 74 additions & 0 deletions
74
Tools/Performance/Comparer/CurrentVersion/MulticlassSupportVectorMachineTest.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,74 @@ | ||
using Accord.MachineLearning.VectorMachines; | ||
using Accord.MachineLearning.VectorMachines.Learning; | ||
using Accord.Statistics.Kernels; | ||
using BenchmarkDotNet.Attributes; | ||
using System.Text; | ||
using System.Threading.Tasks; | ||
using Accord.Math; | ||
using Accord.Math.Distances; | ||
using Accord.Statistics.Distributions.Univariate; | ||
using Accord; | ||
using Shared; | ||
|
||
namespace CurrentVersion | ||
{ | ||
[Config(typeof(FastAndDirtyConfig))] | ||
public class MulticlassSupportVectorMachineTest | ||
{ | ||
private readonly Problem problem; | ||
|
||
MulticlassSupportVectorMachine<Polynomial> ksvm; | ||
MulticlassSupportVectorLearning<Polynomial> smo; | ||
|
||
public MulticlassSupportVectorMachineTest() | ||
{ | ||
problem = Shared.Examples.KaggleDigits(); | ||
} | ||
|
||
[Setup] | ||
public void Setup() | ||
{ | ||
ksvm = new MulticlassSupportVectorMachine<Polynomial>( | ||
inputs: 2, kernel: new Polynomial(2), classes: 10); | ||
|
||
smo = new MulticlassSupportVectorLearning<Polynomial>() | ||
{ | ||
Model = ksvm | ||
}; | ||
} | ||
|
||
[Benchmark] | ||
public IntRange Accord_Core() | ||
{ | ||
return new IntRange(0, 1); | ||
} | ||
|
||
[Benchmark] | ||
public Cosine Accord_Math() | ||
{ | ||
return new Cosine(); | ||
} | ||
|
||
[Benchmark] | ||
public NormalDistribution Accord_Statistics() | ||
{ | ||
return new NormalDistribution(); | ||
} | ||
|
||
[Benchmark] | ||
public MulticlassSupportVectorMachine<Polynomial> v3_1_0() | ||
{ | ||
ksvm = new MulticlassSupportVectorMachine<Polynomial>( | ||
inputs: 2, kernel: new Polynomial(2), classes: 10); | ||
|
||
smo = new MulticlassSupportVectorLearning<Polynomial>() | ||
{ | ||
Model = ksvm | ||
}; | ||
|
||
smo.Learn(problem.Training.Inputs, problem.Testing.Output); | ||
return ksvm; | ||
} | ||
|
||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
using Accord.Statistics.Kernels; | ||
using BenchmarkDotNet.Attributes; | ||
using BenchmarkDotNet.Configs; | ||
using BenchmarkDotNet.Jobs; | ||
using BenchmarkDotNet.Running; | ||
using System; | ||
using System.Collections.Generic; | ||
using System.Linq; | ||
using System.Text; | ||
using System.Threading.Tasks; | ||
|
||
namespace CurrentVersion | ||
{ | ||
class Program | ||
{ | ||
static void Main(string[] args) | ||
{ | ||
BenchmarkRunner.Run<KernelSupportVectorMachineTest>(); | ||
BenchmarkRunner.Run<MulticlassSupportVectorMachineTest>(); | ||
//MulticlassSupportVectorMachineTest().v3_1_0(); | ||
//Console.ReadLine(); | ||
} | ||
|
||
|
||
} | ||
} |
Oops, something went wrong.