Mentions légales du service
Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
faust
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
faust group
faust
Commits
9b73ea08
Commit
9b73ea08
authored
9 years ago
by
Nicolas Bellot
Committed by
hhakim
2 years ago
Browse files
Options
Downloads
Patches
Plain Diff
demo hadamard
parent
d53c9508
No related branches found
No related tags found
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
misc/demo/Hadamard_factorization/speed_up_hadamard.m
+2
-2
2 additions, 2 deletions
misc/demo/Hadamard_factorization/speed_up_hadamard.m
misc/demo/tools/hadamard_mat.m
+0
-113
0 additions, 113 deletions
misc/demo/tools/hadamard_mat.m
with
2 additions
and
115 deletions
misc/demo/Hadamard_factorization/speed_up_hadamard.m
+
2
−
2
View file @
9b73ea08
...
@@ -115,8 +115,8 @@ subplot(1,2,1);
...
@@ -115,8 +115,8 @@ subplot(1,2,1);
semilogy
(
Ms
,
mean_faust_t
,
'linewidth'
,
1.5
);
semilogy
(
Ms
,
mean_faust_t
,
'linewidth'
,
1.5
);
hold
on
hold
on
semilogy
(
Ms
,
mean_dense_t
,
'r'
,
'linewidth'
,
1.5
);
semilogy
(
Ms
,
mean_dense_t
,
'r'
,
'linewidth'
,
1.5
);
ymin
=
min
([
mean_dense_t
(
1
)
,
mean_faust_t
(
1
)
]);
ymin
=
min
([
mean_dense_t
,
mean_faust_t
]);
ymax
=
max
([
mean_dense_t
(
end
)
,
mean_faust_t
(
end
)
]);
ymax
=
max
([
mean_dense_t
,
mean_faust_t
]);
grid
on
grid
on
axis
([
Ms
(
1
)
Ms
(
end
)
ymin
ymax
]);
axis
([
Ms
(
1
)
Ms
(
end
)
ymin
ymax
]);
legend
(
'faust'
,
'dense'
);
legend
(
'faust'
,
'dense'
);
...
...
This diff is collapsed.
Click to expand it.
misc/demo/tools/hadamard_mat.m
+
0
−
113
View file @
9b73ea08
%% Description speed_up_hadamard
%
% This demo makes some time comparison between (Hadamard matrix)-vector multiplication and
% (Hadamard factorisation i.e a FAµST)-vector multiplication for different dimension
% of the Hadamard matrix.
%
% For more information on the FAuST Project, please visit the website of
% the project : <http://faust.gforge.inria.fr>
%
%% License:
% Copyright (2016): Luc Le Magoarou, Remi Gribonval
% INRIA Rennes, FRANCE
% http://www.inria.fr/
%
% The FAuST Toolbox is distributed under the terms of the GNU Affero
% General Public License.
% This program is free software: you can redistribute it and/or modify
% it under the terms of the GNU Affero General Public License as published
% by the Free Software Foundation.
%
% This program is distributed in the hope that it will be useful, but
% WITHOUT ANY WARRANTY; without even the implied warranty of
% MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
% See the GNU Affero General Public License for more details.
%
% You should have received a copy of the GNU Affero General Public License
% along with this program. If not, see <http://www.gnu.org/licenses/>.
%
%% Contacts:
% Nicolas Bellot : nicolas.bellot@inria.fr
% Leman Adrien : adrien.leman@inria.fr
% Luc Le Magoarou: luc.le-magoarou@inria.fr
% Remi Gribonval : remi.gribonval@inria.fr
%
%% References:
% [1] Le Magoarou L. and Gribonval R., "Flexible multi-layer sparse
% approximations of matrices and applications", Journal of Selected
% Topics in Signal Processing, 2016.
% <https://hal.archives-ouvertes.fr/hal-01167948v1>
%%
nb_mult
=
500
;
Ms
=
6
:
11
;
ns
=
2.
^
Ms
;
nb_dim
=
length
(
Ms
);
threshold
=
10
^
(
-
10
);
dense_times
=
zeros
(
nb_mult
,
nb_dim
);
faust_times
=
zeros
(
nb_mult
,
nb_dim
);
h
=
waitbar
(
0
,
'speed up hadamard : Generation of the data ...'
);
Hadamard_matrices
=
cell
(
1
,
nb_dim
);
Hadamard_facts
=
cell
(
1
,
nb_dim
);
for
k
=
1
:
nb_dim
waitbar
(
k
/
nb_dim
);
M
=
Ms
(
k
);
n
=
ns
(
k
);
% generation of the hadamard factorisation
[
H
,
facts
]
=
hadamard_mat
(
M
);
Hadamard_matrices
{
k
}
=
H
;
Hadamard_facts
{
k
}
=
facts
;
end
close
(
h
);
% figure,
% for i=1:M
% subplot(2,M,i);
% imagesc(facts{i});
% axis image
% subplot(2,M,M+i);
% imagesc(cum_Hbis{i});
% axis image
% end
hadamard_faust
=
matlab_faust
(
facts
);
hadamard_dense
=
dvp
(
facts
);
h
=
waitbar
(
0
,
'speed up hadamard : multiplication time comparison ...'
);
for
i
=
1
:
nb_mult
waitbar
(
i
/
nb_mult
);
for
k
=
1
:
nb_dim
n
=
ns
(
k
);
hadamard_dense
=
full
(
Hadamard_matrices
{
k
});
hadamard_faust
=
matlab_faust
(
Hadamard_facts
{
k
});
x
=
rand
(
n
,
1
);
ydense
=
zeros
(
n
,
1
);
yfaust
=
zeros
(
n
,
1
);
tic
ydense
=
hadamard_dense
*
x
;
t1
=
toc
;
tic
yfaust
=
hadamard_faust
*
x
;
t2
=
toc
;
if
(
norm
(
ydense
-
yfaust
)
>
threshold
)
error
(
'speed_up hadamard : multiplication problem'
);
end
dense_times
(
i
,
k
)
=
t1
;
faust_times
(
i
,
k
)
=
t2
;
end
end
close
(
h
);
%% Description hadamard_mat
%% Description hadamard_mat
% Computation of tha Hadamard matrix and its "native" factorization
% Computation of tha Hadamard matrix and its "native" factorization
% [H, Fact] = hadamard_mat(M) computes the Hadamard matrix H of size
% [H, Fact] = hadamard_mat(M) computes the Hadamard matrix H of size
...
@@ -166,10 +60,3 @@ for i=1:M
...
@@ -166,10 +60,3 @@ for i=1:M
end
end
H
=
full
(
dvp
(
Fact
));
H
=
full
(
dvp
(
Fact
));
end
end
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment