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
Admin message
GitLab upgrade completed. Current version is 17.11.4.
Show more breadcrumbs
faust group
faust
Commits
19a3992e
Commit
19a3992e
authored
8 years ago
by
Nicolas Bellot
Committed by
hhakim
2 years ago
Browse files
Options
Downloads
Patches
Plain Diff
repertory demo quickstart
parent
0a556bf6
Branches
Branches containing commit
Tags
Tags containing commit
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
misc/demo/Quick_start/quick_start.m
+100
-0
100 additions, 0 deletions
misc/demo/Quick_start/quick_start.m
with
100 additions
and
0 deletions
misc/demo/Quick_start/quick_start.m
0 → 100644
+
100
−
0
View file @
19a3992e
%% Description quick_start
%
% This demo shows that a Faust is handled as matlab builtin matrix,
% presenting all the function that are overloaded for Faust class
% (size,mtimes,transpose...)
% and ends with a little time comparison to illustrate
% the speed-up of using a Faust for multiplication.
%
% For more information on the FAuST Project, please visit the website of
% the project : <http://faust.gforge.inria.fr>
%
%% License:
% Copyright (2016): Nicolas Bellot, Adrien Leman, Thomas Gautrais, 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
% Adrien Leman : adrien.leman@inria.fr
% Thomas Gautrais : thomas.gautrais@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>
%
%%
% loading a Faust A from saved-one
A
=
Faust
(
'faust_quick_start.mat'
);
% get the size of the faust
[
dim1
,
dim2
]
=
size
(
A
);
% transpose a faust
A_trans
=
A
'
;
% multiplication by A
x1
=
rand
(
dim2
,
1
);
y1
=
A
*
x1
;
% multiplication by A'
x2
=
rand
(
dim1
,
5
);
y2
=
A
'*
x2
;
% get the 2-norm (spectral norm) of the faust A
norm_A
=
norm
(
A
);
% equivalent to norm(A,2);
% convert Faust to full matrix
A_full
=
full
(
A
);
% get the coefficient i,j and slicing for reading purpose
coeff
=
A
(
3
,
4
);
col_2
=
A
(:,
2
);
submatrix_A
=
A
(
3
:
5
,
2
:
3
);
submatrix_A
=
A
(
2
:
end
,
3
:
end
-
1
);
% Warning : A(i,j)=3 will not modify A, writing is not allowed
% get the number of non-zeros coefficient
nz
=
nnz
(
A
);
%% speed-up multiplication
nb_mult
=
100
;
time_full
=
0
;
time_faust
=
0
;
for
i
=
1
:
nb_mult
tic
y
=
A_full
*
x1
;
time_full
=
time_full
+
toc
;
tic
y
=
A
*
x1
;
time_faust
=
time_faust
+
toc
;
end
disp
(
'multiplication SPEED-UP using Faust'
);
disp
([
'Faust is '
num2str
(
time_full
/
time_faust
)
' faster than a full matrix'
]);
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