Skip to content

Commit

Permalink
added more examples and changed working directory to the bin dir
Browse files Browse the repository at this point in the history
  • Loading branch information
steffennissen committed Sep 29, 2011
1 parent 42a0ead commit 3701297
Show file tree
Hide file tree
Showing 19 changed files with 217 additions and 9 deletions.
92 changes: 92 additions & 0 deletions VS2010/cascade_train/cascade_train.vcxproj
Original file line number Diff line number Diff line change
@@ -0,0 +1,92 @@
<?xml version="1.0" encoding="utf-8"?>
<Project DefaultTargets="Build" ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<ItemGroup Label="ProjectConfigurations">
<ProjectConfiguration Include="Debug|Win32">
<Configuration>Debug</Configuration>
<Platform>Win32</Platform>
</ProjectConfiguration>
<ProjectConfiguration Include="Release|Win32">
<Configuration>Release</Configuration>
<Platform>Win32</Platform>
</ProjectConfiguration>
</ItemGroup>
<PropertyGroup Label="Globals">
<ProjectGuid>{CD6C5091-1707-45BA-B315-FAE26681273C}</ProjectGuid>
<Keyword>Win32Proj</Keyword>
<RootNamespace>simple_train</RootNamespace>
</PropertyGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" />
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" Label="Configuration">
<ConfigurationType>Application</ConfigurationType>
<UseDebugLibraries>true</UseDebugLibraries>
<CharacterSet>Unicode</CharacterSet>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" Label="Configuration">
<ConfigurationType>Application</ConfigurationType>
<UseDebugLibraries>false</UseDebugLibraries>
<WholeProgramOptimization>true</WholeProgramOptimization>
<CharacterSet>Unicode</CharacterSet>
</PropertyGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.props" />
<ImportGroup Label="ExtensionSettings">
</ImportGroup>
<ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
</ImportGroup>
<ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
</ImportGroup>
<PropertyGroup Label="UserMacros" />
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
<LinkIncremental>true</LinkIncremental>
<OutDir>$(SolutionDir)..\bin\</OutDir>
<TargetName>$(ProjectName)d</TargetName>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
<LinkIncremental>false</LinkIncremental>
<OutDir>$(SolutionDir)..\bin\</OutDir>
</PropertyGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
<ClCompile>
<PrecompiledHeader>
</PrecompiledHeader>
<WarningLevel>Level3</WarningLevel>
<Optimization>Disabled</Optimization>
<PreprocessorDefinitions>WIN32;_DEBUG;_CONSOLE;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<AdditionalIncludeDirectories>..\..\src\include</AdditionalIncludeDirectories>
</ClCompile>
<Link>
<SubSystem>Console</SubSystem>
<GenerateDebugInformation>true</GenerateDebugInformation>
</Link>
</ItemDefinitionGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
<ClCompile>
<WarningLevel>Level3</WarningLevel>
<PrecompiledHeader>
</PrecompiledHeader>
<Optimization>MaxSpeed</Optimization>
<FunctionLevelLinking>true</FunctionLevelLinking>
<IntrinsicFunctions>true</IntrinsicFunctions>
<PreprocessorDefinitions>WIN32;NDEBUG;_CONSOLE;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<AdditionalIncludeDirectories>..\..\src\include</AdditionalIncludeDirectories>
</ClCompile>
<Link>
<SubSystem>Console</SubSystem>
<GenerateDebugInformation>true</GenerateDebugInformation>
<EnableCOMDATFolding>true</EnableCOMDATFolding>
<OptimizeReferences>true</OptimizeReferences>
</Link>
</ItemDefinitionGroup>
<ItemGroup>
<ClCompile Include="..\..\examples\cascade_train.c" />
</ItemGroup>
<ItemGroup>
<ProjectReference Include="..\fannfloat\fannfloat.vcxproj">
<Project>{2f0ec4b6-b3f8-4a05-a884-b935e82e1390}</Project>
</ProjectReference>
</ItemGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
<ImportGroup Label="ExtensionTargets">
</ImportGroup>
</Project>
6 changes: 6 additions & 0 deletions VS2010/cascade_train/cascade_train.vcxproj.filters
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<ItemGroup>
<ClCompile Include="..\..\examples\cascade_train.c" />
</ItemGroup>
</Project>
12 changes: 12 additions & 0 deletions VS2010/fann.sln
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,10 @@ Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "xor_test_float", "xor_test_
EndProject
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "xor_test_fixed", "xor_test_fixed\xor_test_fixed.vcxproj", "{3A55ED6A-A42D-47A4-9E4A-FB702E7B2F7B}"
EndProject
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "cascade_train", "cascade_train\cascade_train.vcxproj", "{CD6C5091-1707-45BA-B315-FAE26681273C}"
EndProject
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "momentums", "momentums\momentums.vcxproj", "{993ECF93-83E8-4CD2-8F94-C33B1FB77969}"
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|Win32 = Debug|Win32
Expand Down Expand Up @@ -55,6 +59,14 @@ Global
{3A55ED6A-A42D-47A4-9E4A-FB702E7B2F7B}.Debug|Win32.Build.0 = Debug|Win32
{3A55ED6A-A42D-47A4-9E4A-FB702E7B2F7B}.Release|Win32.ActiveCfg = Release|Win32
{3A55ED6A-A42D-47A4-9E4A-FB702E7B2F7B}.Release|Win32.Build.0 = Release|Win32
{CD6C5091-1707-45BA-B315-FAE26681273C}.Debug|Win32.ActiveCfg = Debug|Win32
{CD6C5091-1707-45BA-B315-FAE26681273C}.Debug|Win32.Build.0 = Debug|Win32
{CD6C5091-1707-45BA-B315-FAE26681273C}.Release|Win32.ActiveCfg = Release|Win32
{CD6C5091-1707-45BA-B315-FAE26681273C}.Release|Win32.Build.0 = Release|Win32
{993ECF93-83E8-4CD2-8F94-C33B1FB77969}.Debug|Win32.ActiveCfg = Debug|Win32
{993ECF93-83E8-4CD2-8F94-C33B1FB77969}.Debug|Win32.Build.0 = Debug|Win32
{993ECF93-83E8-4CD2-8F94-C33B1FB77969}.Release|Win32.ActiveCfg = Release|Win32
{993ECF93-83E8-4CD2-8F94-C33B1FB77969}.Release|Win32.Build.0 = Release|Win32
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
Expand Down
92 changes: 92 additions & 0 deletions VS2010/momentums/momentums.vcxproj
Original file line number Diff line number Diff line change
@@ -0,0 +1,92 @@
<?xml version="1.0" encoding="utf-8"?>
<Project DefaultTargets="Build" ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<ItemGroup Label="ProjectConfigurations">
<ProjectConfiguration Include="Debug|Win32">
<Configuration>Debug</Configuration>
<Platform>Win32</Platform>
</ProjectConfiguration>
<ProjectConfiguration Include="Release|Win32">
<Configuration>Release</Configuration>
<Platform>Win32</Platform>
</ProjectConfiguration>
</ItemGroup>
<PropertyGroup Label="Globals">
<ProjectGuid>{993ECF93-83E8-4CD2-8F94-C33B1FB77969}</ProjectGuid>
<Keyword>Win32Proj</Keyword>
<RootNamespace>simple_train</RootNamespace>
</PropertyGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" />
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" Label="Configuration">
<ConfigurationType>Application</ConfigurationType>
<UseDebugLibraries>true</UseDebugLibraries>
<CharacterSet>Unicode</CharacterSet>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" Label="Configuration">
<ConfigurationType>Application</ConfigurationType>
<UseDebugLibraries>false</UseDebugLibraries>
<WholeProgramOptimization>true</WholeProgramOptimization>
<CharacterSet>Unicode</CharacterSet>
</PropertyGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.props" />
<ImportGroup Label="ExtensionSettings">
</ImportGroup>
<ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
</ImportGroup>
<ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
</ImportGroup>
<PropertyGroup Label="UserMacros" />
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
<LinkIncremental>true</LinkIncremental>
<OutDir>$(SolutionDir)..\bin\</OutDir>
<TargetName>$(ProjectName)d</TargetName>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
<LinkIncremental>false</LinkIncremental>
<OutDir>$(SolutionDir)..\bin\</OutDir>
</PropertyGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
<ClCompile>
<PrecompiledHeader>
</PrecompiledHeader>
<WarningLevel>Level3</WarningLevel>
<Optimization>Disabled</Optimization>
<PreprocessorDefinitions>WIN32;_DEBUG;_CONSOLE;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<AdditionalIncludeDirectories>..\..\src\include</AdditionalIncludeDirectories>
</ClCompile>
<Link>
<SubSystem>Console</SubSystem>
<GenerateDebugInformation>true</GenerateDebugInformation>
</Link>
</ItemDefinitionGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
<ClCompile>
<WarningLevel>Level3</WarningLevel>
<PrecompiledHeader>
</PrecompiledHeader>
<Optimization>MaxSpeed</Optimization>
<FunctionLevelLinking>true</FunctionLevelLinking>
<IntrinsicFunctions>true</IntrinsicFunctions>
<PreprocessorDefinitions>WIN32;NDEBUG;_CONSOLE;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<AdditionalIncludeDirectories>..\..\src\include</AdditionalIncludeDirectories>
</ClCompile>
<Link>
<SubSystem>Console</SubSystem>
<GenerateDebugInformation>true</GenerateDebugInformation>
<EnableCOMDATFolding>true</EnableCOMDATFolding>
<OptimizeReferences>true</OptimizeReferences>
</Link>
</ItemDefinitionGroup>
<ItemGroup>
<ProjectReference Include="..\fannfloat\fannfloat.vcxproj">
<Project>{2f0ec4b6-b3f8-4a05-a884-b935e82e1390}</Project>
</ProjectReference>
</ItemGroup>
<ItemGroup>
<ClCompile Include="..\..\examples\momentums.c" />
</ItemGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
<ImportGroup Label="ExtensionTargets">
</ImportGroup>
</Project>
6 changes: 6 additions & 0 deletions VS2010/momentums/momentums.vcxproj.filters
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<ItemGroup>
<ClCompile Include="..\..\examples\momentums.c" />
</ItemGroup>
</Project>
Binary file modified bin/fanndouble.dll
Binary file not shown.
Binary file modified bin/fanndouble.lib
Binary file not shown.
Binary file modified bin/fannfixed.dll
Binary file not shown.
Binary file modified bin/fannfixed.lib
Binary file not shown.
Binary file modified bin/fannfloat.dll
Binary file not shown.
Binary file modified bin/fannfloat.lib
Binary file not shown.
Binary file modified bin/simple_train_double.exe
Binary file not shown.
Binary file modified bin/simple_train_float.exe
Binary file not shown.
Binary file modified bin/xor_test_fixed.exe
Binary file not shown.
Binary file modified bin/xor_test_float.exe
Binary file not shown.
Binary file modified bin/xor_train.exe
Binary file not shown.
10 changes: 5 additions & 5 deletions examples/cascade_train.c
Original file line number Diff line number Diff line change
Expand Up @@ -40,8 +40,8 @@ int main()

printf("Reading data.\n");

train_data = fann_read_train_from_file("../benchmarks/datasets/parity8.train");
test_data = fann_read_train_from_file("../benchmarks/datasets/parity8.test");
train_data = fann_read_train_from_file("../datasets/parity8.train");
test_data = fann_read_train_from_file("../datasets/parity8.test");

fann_scale_train_data(train_data, -1, 1);
fann_scale_train_data(test_data, -1, 1);
Expand Down Expand Up @@ -69,11 +69,11 @@ int main()

if(training_algorithm == FANN_TRAIN_QUICKPROP)
{
fann_set_learning_rate(ann, 0.35);
fann_randomize_weights(ann, -2.0,2.0);
fann_set_learning_rate(ann, 0.35f);
fann_randomize_weights(ann, -2.0f, 2.0f);
}

fann_set_bit_fail_limit(ann, 0.9);
fann_set_bit_fail_limit(ann, (fann_type)0.9);
fann_set_train_stop_function(ann, FANN_STOPFUNC_BIT);
fann_print_parameters(ann);

Expand Down
6 changes: 3 additions & 3 deletions examples/momentums.c
Original file line number Diff line number Diff line change
Expand Up @@ -31,10 +31,10 @@ int main()

float momentum;

train_data = fann_read_train_from_file("../benchmarks/datasets/robot.train");
test_data = fann_read_train_from_file("../benchmarks/datasets/robot.test");
train_data = fann_read_train_from_file("../datasets/robot.train");
test_data = fann_read_train_from_file("../datasets/robot.test");

for ( momentum = 0.0; momentum < 0.7; momentum += 0.1 )
for ( momentum = 0.0f; momentum < 0.7f; momentum += 0.1f )
{
printf("============= momentum = %f =============\n", momentum);

Expand Down
2 changes: 1 addition & 1 deletion examples/xor_test.c
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ int main()
if(!ann)
{
printf("Error creating ann --- ABORTING.\n");
return 0;
return -1;
}

fann_print_connections(ann);
Expand Down

0 comments on commit 3701297

Please sign in to comment.