Skip to content

Commit 8eff890

Browse files
author
hzyereba
committed
Built with MKL FastMat
1 parent 1982d0c commit 8eff890

16 files changed

+70
-63
lines changed

.gitignore

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
/UncollapsedSampler/x64/Debug/*.obj
2+
/UncollapsedSampler/x64/Debug/Uncollap.4BD86494.tlog/*.tlog
3+
/UncollapsedSampler/x64/Debug/*.log
4+
/UncollapsedSampler/x64/Debug/*.cache
5+
/UncollapsedSampler/x64/Release/*.obj
6+
/UncollapsedSampler/x64/Release/*.sbr
7+
/UncollapsedSampler/x64/Release/Uncollap.4BD86494.tlog/*.tlog
8+
/UncollapsedSampler/x64/Release/Uncollap.4BD86494.tlog/*.lastbuildstate
9+
/UncollapsedSampler/x64/Release/*.log
10+
/UncollapsedSampler/x64/Release/*.cache
11+
/UncollapsedSampler/x64/Release/*.pdb
12+
/*.labels
13+
/*.likelihood
14+
/*.rest
15+
/run/experiments/mnist/*.matrix
16+
/run/experiments/mnist/*.labels
17+
/run/experiments/parallel/*.matrix
18+
/run/experiments/parallel/*.labels
19+
/run/experiments/parallel/*.likelihood
20+
/run/experiments/parallel/coords_ryan/plots/*.eps
21+
/run/experiments/parallel/*.rest
22+
/run/experiments/parallel/*.bin
23+
/run/experiments/parallel/*.log
24+
/run/experiments/parallel/mnist/*.matrix
25+
/run/experiments/parallel/mnist/*.labels

UncollapsedSampler/UncollapsedSampler.vcxproj

Lines changed: 13 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -27,28 +27,30 @@
2727
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" Label="Configuration">
2828
<ConfigurationType>Application</ConfigurationType>
2929
<UseDebugLibraries>true</UseDebugLibraries>
30-
<PlatformToolset>v140</PlatformToolset>
30+
<PlatformToolset>Intel C++ Compiler 17.0</PlatformToolset>
3131
<CharacterSet>MultiByte</CharacterSet>
3232
</PropertyGroup>
3333
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" Label="Configuration">
3434
<ConfigurationType>Application</ConfigurationType>
3535
<UseDebugLibraries>false</UseDebugLibraries>
36-
<PlatformToolset>v140</PlatformToolset>
36+
<PlatformToolset>Intel C++ Compiler 17.0</PlatformToolset>
3737
<WholeProgramOptimization>true</WholeProgramOptimization>
3838
<CharacterSet>MultiByte</CharacterSet>
3939
</PropertyGroup>
4040
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'" Label="Configuration">
4141
<ConfigurationType>Application</ConfigurationType>
4242
<UseDebugLibraries>true</UseDebugLibraries>
43-
<PlatformToolset>v140</PlatformToolset>
43+
<PlatformToolset>Intel C++ Compiler 17.0</PlatformToolset>
4444
<CharacterSet>MultiByte</CharacterSet>
45+
<UseIntelMKL>Parallel</UseIntelMKL>
4546
</PropertyGroup>
4647
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'" Label="Configuration">
4748
<ConfigurationType>Application</ConfigurationType>
4849
<UseDebugLibraries>false</UseDebugLibraries>
49-
<PlatformToolset>v140</PlatformToolset>
50+
<PlatformToolset>Intel C++ Compiler 17.0</PlatformToolset>
5051
<WholeProgramOptimization>true</WholeProgramOptimization>
5152
<CharacterSet>MultiByte</CharacterSet>
53+
<UseIntelMKL>Parallel</UseIntelMKL>
5254
</PropertyGroup>
5355
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.props" />
5456
<ImportGroup Label="ExtensionSettings">
@@ -70,10 +72,12 @@
7072
<PropertyGroup Label="UserMacros" />
7173
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
7274
<OutDir>$(SolutionDir)$</OutDir>
75+
<IncludePath>C:\Program Files %28x86%29\IntelSWTools\compilers_and_libraries_2017.0.109\windows\mkl\include;$(VC_IncludePath);$(WindowsSDK_IncludePath);$(VC_IncludePath);$(WindowsSDK_IncludePath);</IncludePath>
7376
</PropertyGroup>
7477
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
7578
<TargetName>ppcg</TargetName>
7679
<OutDir>$(SolutionDir)run\</OutDir>
80+
<IncludePath>C:\Program Files %28x86%29\IntelSWTools\compilers_and_libraries_2017.0.109\windows\mkl\include;$(VC_IncludePath);$(WindowsSDK_IncludePath);$(VC_IncludePath);$(WindowsSDK_IncludePath);</IncludePath>
7781
</PropertyGroup>
7882
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
7983
<ClCompile>
@@ -90,10 +94,11 @@
9094
<Optimization>Disabled</Optimization>
9195
<SDLCheck>true</SDLCheck>
9296
<AdditionalIncludeDirectories>../../FastMat;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
93-
<BrowseInformation>true</BrowseInformation>
97+
<BrowseInformation>false</BrowseInformation>
98+
<RuntimeLibrary>MultiThreadedDebug</RuntimeLibrary>
9499
</ClCompile>
95100
<Link>
96-
<AdditionalDependencies>kernel32.lib;user32.lib;gdi32.lib;winspool.lib;comdlg32.lib;advapi32.lib;shell32.lib;ole32.lib;oleaut32.lib;uuid.lib;odbc32.lib;odbccp32.lib;%(AdditionalDependencies)</AdditionalDependencies>
101+
<AdditionalDependencies>mkl_intel_thread.lib;mkl_core.lib;libiomp5md.lib;kernel32.lib;user32.lib;gdi32.lib;winspool.lib;comdlg32.lib;advapi32.lib;shell32.lib;ole32.lib;oleaut32.lib;uuid.lib;odbc32.lib;odbccp32.lib;%(AdditionalDependencies)</AdditionalDependencies>
97102
</Link>
98103
<Bscmake>
99104
<PreserveSbr>true</PreserveSbr>
@@ -124,12 +129,12 @@
124129
<SDLCheck>true</SDLCheck>
125130
<AdditionalIncludeDirectories>..\..\FastMat;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
126131
<RuntimeLibrary>MultiThreaded</RuntimeLibrary>
127-
<BrowseInformation>true</BrowseInformation>
132+
<BrowseInformation>false</BrowseInformation>
128133
</ClCompile>
129134
<Link>
130135
<EnableCOMDATFolding>true</EnableCOMDATFolding>
131136
<OptimizeReferences>true</OptimizeReferences>
132-
<AdditionalDependencies>kernel32.lib;user32.lib;gdi32.lib;winspool.lib;comdlg32.lib;advapi32.lib;shell32.lib;ole32.lib;oleaut32.lib;uuid.lib;odbc32.lib;odbccp32.lib;%(AdditionalDependencies)</AdditionalDependencies>
137+
<AdditionalDependencies>mkl_intel_thread.lib;mkl_core.lib;libiomp5md.lib;kernel32.lib;user32.lib;gdi32.lib;winspool.lib;comdlg32.lib;advapi32.lib;shell32.lib;ole32.lib;oleaut32.lib;uuid.lib;odbc32.lib;odbccp32.lib;%(AdditionalDependencies)</AdditionalDependencies>
133138
</Link>
134139
<Bscmake>
135140
<PreserveSbr>true</PreserveSbr>

UncollapsedSampler/UncollapsedSampler.vcxproj.user

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,12 @@
11
<?xml version="1.0" encoding="utf-8"?>
22
<Project ToolsVersion="14.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
33
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
4-
<LocalDebuggerCommandArguments>run\experiments\pines\pines.matrix run\experiments\pines\pines_prior.matrix run\experiments\pines\pines_params.matrix 2000</LocalDebuggerCommandArguments>
4+
<LocalDebuggerCommandArguments>run\experiments\mnist\mnist.matrix run\experiments\mnist\mnist_prior.matrix run\experiments\mnist\mnist_params.matrix 500</LocalDebuggerCommandArguments>
55
<DebuggerFlavor>WindowsLocalDebugger</DebuggerFlavor>
66
<LocalDebuggerWorkingDirectory>..</LocalDebuggerWorkingDirectory>
77
</PropertyGroup>
88
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
9-
<LocalDebuggerCommandArguments>run\experiments\pines\pines.matrix run\experiments\pines\pines_prior.matrix run\experiments\pines\pines_params.matrix 2000</LocalDebuggerCommandArguments>
9+
<LocalDebuggerCommandArguments>run\experiments\parallel\mnist.matrix run\experiments\parallel\mnist_prior.matrix run\experiments\parallel\mnist_params.matrix 500</LocalDebuggerCommandArguments>
1010
<DebuggerFlavor>WindowsLocalDebugger</DebuggerFlavor>
1111
<LocalDebuggerWorkingDirectory>..</LocalDebuggerWorkingDirectory>
1212
</PropertyGroup>

UncollapsedSampler/igmm.cpp

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,7 @@ int main(int argc, char** argv)
5757
//if (argc>7)
5858
// SAMPLE = atoi(argv[7]);
5959

60-
step();
60+
6161

6262
string ss(result_dir);
6363
printf("Reading...\n");
@@ -92,6 +92,8 @@ int main(int argc, char** argv)
9292
int nlabelsample = ((MAX_SWEEP - BURNIN) / STEP);
9393
Matrix sampledLabels(nlabelsample,n);
9494
Vector likelihoods(MAX_SWEEP);
95+
PILL_DEBUG;
96+
step();
9597
for (auto iter = 0; iter < MAX_SWEEP; iter++)
9698
{
9799

@@ -141,7 +143,8 @@ int main(int argc, char** argv)
141143

142144

143145

144-
146+
step();
147+
145148
string s(result_dir);
146149
ofstream restfile(s.append("_igmm.rest"), ios::out | ios::binary);
147150

Binary file not shown.
Binary file not shown.
Binary file not shown.
Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,2 @@
1-
#TargetFrameworkVersion=v4.0:PlatformToolSet=v140:EnableManagedIncrementalBuild=false:VCToolArchitecture=Native32Bit:WindowsTargetPlatformVersion=8.1
2-
Debug|x64|C:\Users\halidziya\Desktop\I2GMM\UncollapsedSampler\|
1+
#TargetFrameworkVersion=v4.0:PlatformToolSet=Intel C++ Compiler 17.0:EnableManagedIncrementalBuild=false:VCToolArchitecture=Native64Bit:WindowsTargetPlatformVersion=8.1
2+
Debug|x64|C:\Users\hzyereba\Desktop\I2Slice\I2Slice\|
Binary file not shown.
Binary file not shown.
Binary file not shown.
Lines changed: 4 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -1,31 +1,5 @@
11
C:\Program Files (x86)\MSBuild\Microsoft.Cpp\v4.0\V140\Microsoft.CppBuild.targets(368,5): warning MSB8004: Output Directory does not end with a trailing slash. This build instance will add the slash as it is required to allow proper evaluation of the Output Directory.
2-
igmm.cpp
3-
c:\users\halidziya\desktop\i2gmm\uncollapsedsampler\uncollapsedsampler\igmm.cpp(75): warning C4244: 'argument': conversion from 'time_t' to 'unsigned int', possible loss of data
4-
c:\users\halidziya\desktop\i2gmm\uncollapsedsampler\uncollapsedsampler\igmm.cpp(76): warning C4244: 'argument': conversion from 'time_t' to 'unsigned int', possible loss of data
5-
c:\users\halidziya\desktop\i2gmm\uncollapsedsampler\uncollapsedsampler\igmm.cpp(137): warning C4244: 'argument': conversion from 'double' to 'const int', possible loss of data
6-
c:\users\halidziya\desktop\i2gmm\uncollapsedsampler\uncollapsedsampler\igmm.cpp(89): warning C4477: 'printf' : format string '%d' requires an argument of type 'int', but variadic argument 1 has type 'unsigned __int64'
7-
c:\users\halidziya\desktop\i2gmm\uncollapsedsampler\uncollapsedsampler\igmm.cpp(89): note: consider using '%zd' in the format string
8-
c:\users\halidziya\desktop\i2gmm\uncollapsedsampler\uncollapsedsampler\igmm.cpp(109): warning C4477: 'printf' : format string '%d' requires an argument of type 'int', but variadic argument 1 has type 'unsigned __int64'
9-
c:\users\halidziya\desktop\i2gmm\uncollapsedsampler\uncollapsedsampler\igmm.cpp(109): note: consider using '%zd' in the format string
10-
Generating Code...
11-
Compiling...
12-
Table.cpp
13-
Restaurant.cpp
14-
c:\users\halidziya\desktop\i2gmm\uncollapsedsampler\uncollapsedsampler\restaurant.cpp(157): warning C4267: 'argument': conversion from 'size_t' to 'int', possible loss of data
15-
c:\users\halidziya\desktop\i2gmm\uncollapsedsampler\uncollapsedsampler\restaurant.cpp(174): warning C4244: 'argument': conversion from 'time_t' to 'unsigned int', possible loss of data
16-
c:\users\halidziya\desktop\i2gmm\uncollapsedsampler\uncollapsedsampler\restaurant.cpp(186): warning C4244: 'argument': conversion from 'double' to 'unsigned __int64', possible loss of data
17-
c:\users\halidziya\desktop\i2gmm\uncollapsedsampler\uncollapsedsampler\restaurant.cpp(187): warning C4244: 'argument': conversion from 'double' to 'unsigned __int64', possible loss of data
18-
c:\users\halidziya\desktop\i2gmm\uncollapsedsampler\uncollapsedsampler\restaurant.cpp(202): warning C4477: 'printf' : format string '%d' requires an argument of type 'int', but variadic argument 1 has type 'double'
19-
c:\users\halidziya\desktop\i2gmm\uncollapsedsampler\uncollapsedsampler\restaurant.cpp(342): warning C4267: 'initializing': conversion from 'size_t' to 'int', possible loss of data
20-
c:\users\halidziya\desktop\i2gmm\uncollapsedsampler\uncollapsedsampler\restaurant.cpp(341): warning C4477: 'printf' : format string '%d' requires an argument of type 'int', but variadic argument 1 has type 'unsigned __int64'
21-
c:\users\halidziya\desktop\i2gmm\uncollapsedsampler\uncollapsedsampler\restaurant.cpp(341): note: consider using '%zd' in the format string
22-
c:\users\halidziya\desktop\i2gmm\uncollapsedsampler\uncollapsedsampler\restaurant.cpp(341): warning C4477: 'printf' : format string '%d' requires an argument of type 'int', but variadic argument 2 has type 'unsigned __int64'
23-
c:\users\halidziya\desktop\i2gmm\uncollapsedsampler\uncollapsedsampler\restaurant.cpp(341): note: consider using '%zd' in the format string
24-
c:\users\halidziya\desktop\i2gmm\uncollapsedsampler\uncollapsedsampler\restaurant.cpp(361): warning C4267: 'initializing': conversion from 'size_t' to 'int', possible loss of data
25-
DataSet.cpp
26-
c:\users\halidziya\desktop\i2gmm\uncollapsedsampler\uncollapsedsampler\dataset.cpp(21): warning C4244: '=': conversion from 'double' to 'int', possible loss of data
27-
c:\users\halidziya\desktop\i2gmm\uncollapsedsampler\uncollapsedsampler\dataset.cpp(35): warning C4244: 'initializing': conversion from 'double' to 'int', possible loss of data
28-
Algorithms.cpp
29-
Generating Code...
30-
UncollapsedSampler.vcxproj -> C:\Users\halidziya\Desktop\I2GMM\UncollapsedSampler\$\UncollapsedSampler.exe
31-
UncollapsedSampler.vcxproj -> C:\Users\halidziya\Desktop\I2GMM\UncollapsedSampler\$\UncollapsedSampler.pdb (Partial PDB)
2+
ipo: : warning #11087: C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\lib\amd64\libcpmt.lib: mismatch detected for '_ITERATOR_DEBUG_LEVEL': value '0' does not match value '2' in C:\Users\hzyereba\Desktop\PPCG\UncollapsedSampler\x64\Debug\Algorithms.obj.
3+
ipo: : warning #11087: C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\lib\amd64\libcpmt.lib: mismatch detected for 'RuntimeLibrary': value 'MT_StaticRelease' does not match value 'MTd_StaticDebug' in C:\Users\hzyereba\Desktop\PPCG\UncollapsedSampler\x64\Debug\Algorithms.obj.
4+
ipo: : warning #11087: C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\lib\amd64\libcpmt.lib: mismatch detected for '_ITERATOR_DEBUG_LEVEL': value '0' does not match value '2' in C:\Users\hzyereba\Desktop\PPCG\UncollapsedSampler\x64\Debug\Algorithms.obj.
5+
ipo: : warning #11087: C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\lib\amd64\libcpmt.lib: mismatch detected for 'RuntimeLibrary': value 'MT_StaticRelease' does not match value 'MTd_StaticDebug' in C:\Users\hzyereba\Desktop\PPCG\UncollapsedSampler\x64\Debug\Algorithms.obj.
-1.52 MB
Binary file not shown.
-208 KB
Binary file not shown.

run/igmm_parallel.m

Lines changed: 19 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
experiments='experiments/';
22
folder = strcat(experiments,'parallel');
33
igmm_mkdir(folder);
4-
[files names] = igmm_datasets('..\data'); % Traverse in folder
4+
[files names] = igmm_datasets('..\..\data'); % Traverse in folder
55
MAXITER=10;
66
elapsed_time = zeros(length(files),4,MAXITER);
77
macf1 = zeros(length(files),4,MAXITER);
@@ -100,23 +100,23 @@
100100
% end
101101
% end
102102

103-
104-
tic;
105-
[labels,E]=run_dpgmm_subclusters(X', 10, false, 8, false, false, 1, 500, 500);
106-
labels = align_labels(labels);
107-
p=histc(labels,unique(labels))/length(labels);
108-
effectiven(datai,2,iter) = exp(-sum(p.*log(p)));
109-
%labels=run_dpgmm_fsd(X',1,false,8,1,40,40);
110-
elapsed_time(datai,2,iter)=toc;
111-
f1s=evaluationTable(Y(Y~=0),labels(Y~=0));
112-
macf1(datai,2,iter)=table2array(f1s(1,1));
113-
micf1(datai,2,iter)=table2array(f1s(1,2));
114-
numtables(datai,2,iter) = length(unique(labels));
115-
changlikelihood(:,iter)=E;
116-
subplot(2,2,2);
117-
scatter(X(:,1),X(:,2),40,labels,'.')
118-
title([ 'JChang Sampler: ' num2str(macf1(datai,2,iter))]);
119-
103+
%
104+
% tic;
105+
% [labels,E]=run_dpgmm_subclusters(X', 10, false, 8, false, false, 1, 500, 500);
106+
% labels = align_labels(labels);
107+
% p=histc(labels,unique(labels))/length(labels);
108+
% effectiven(datai,2,iter) = exp(-sum(p.*log(p)));
109+
% %labels=run_dpgmm_fsd(X',1,false,8,1,40,40);
110+
% elapsed_time(datai,2,iter)=toc;
111+
% f1s=evaluationTable(Y(Y~=0),labels(Y~=0));
112+
% macf1(datai,2,iter)=table2array(f1s(1,1));
113+
% micf1(datai,2,iter)=table2array(f1s(1,2));
114+
% numtables(datai,2,iter) = length(unique(labels));
115+
% changlikelihood(:,iter)=E;
116+
% subplot(2,2,2);
117+
% scatter(X(:,1),X(:,2),40,labels,'.')
118+
% title([ 'JChang Sampler: ' num2str(macf1(datai,2,iter))]);
119+
%
120120

121121

122122
burn_in = '300';
@@ -154,7 +154,7 @@
154154

155155
plot([mean(likelihood,2)],'k:','linewidth',3);hold on;
156156
plot([mean(slikelihood,2)],'linewidth',3);hold on;
157-
plot([mean(changlikelihood(1:size(likelihood,1),:),2)],'r--','linewidth',3);hold off;
157+
%plot([mean(changlikelihood(1:size(likelihood,1),:),2)],'r--','linewidth',3);hold off;
158158

159159
%title('Likelihoods','FontSize',18);
160160
h=legend(['PPCG';'PSS ';'SUBC'],'Location','southeast');

run/ppcg.exe

9.09 MB
Binary file not shown.

0 commit comments

Comments
 (0)