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
2b44543d
Commit
2b44543d
authored
8 years ago
by
Nicolas Bellot
Committed by
hhakim
2 years ago
Browse files
Options
Downloads
Patches
Plain Diff
fichier inutile
parent
9e9a4fd2
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/test/src/test_faust.cpp.in
+0
-144
0 additions, 144 deletions
misc/test/src/test_faust.cpp.in
with
0 additions
and
144 deletions
misc/test/src/test_faust.cpp.in
deleted
100755 → 0
+
0
−
144
View file @
9e9a4fd2
/****************************************************************************/
/* Description: */
/* 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> */
/****************************************************************************/
#include "faust_core.h"
#include "faust_params.h"
#include "faust_init_from_matio_params.h"
#include "hierarchical_fact.h"
#include "faust_vec.h"
#include "faust_timer.h"
#include <iostream>
using namespace std;
typedef FFPP FPP;
/** \brief Evaluate the time difference using faust or classical-dense matrix, <br>
in a context of the multiplication between an matrix and a vector <br>
* \param[in] Entry Matrix is contained in a file .mat
* \param[out] Output data is placed in a file .dat
*/
int main()
{
// si true : MEG_fact
// si false : demo_dico_learning_compared
bool testMEG = true;
// init from params
faust_params<FPP> params;
if (testMEG)
init_params_from_matiofile(params, "@FAUST_DATA_MAT_DIR@/config_MEG.mat", "params");
else
init_params_from_matiofile(params, "@FAUST_DATA_MAT_DIR@/config_compared_hierarchical_fact.mat", "params");
//cout << "update_way=" << params.isUpdateWayR2L << endl;
/*vector<faust_spmat<FPP> > facts;
faust_core<FPP> faust(params);
faust.get_facts(facts);
(facts[0]) *=
char filename[100];
for (int i=0 ; i<facts.size() ; i++)
{
if (testMEG)
sprintf(filename, "facts_MEG%d.dat", i+1);
else
sprintf(filename, "facts_hier_fact%d.dat", i+1);
facts[i].print_file(filename);
}*/
// init from vector of faust_spmat
vector<faust_spmat<FPP> > facts;
if (testMEG)
facts.resize(6);
else
facts.resize(4);
char filename[100];
for (int i=0 ; i<facts.size() ; i++)
{
if (testMEG)
sprintf(filename, "@FAUST_DATA_MAT_DIR@/facts_MEG%d.txt", i);
else
sprintf(filename, "@FAUST_DATA_MAT_DIR@/learning_compared_fact%d.txt", i);
facts[i].init_from_file(filename);
}
faust_core<FPP> faust(facts, (FFPP)1.0);
faust_vec<FPP> vec_in(facts[facts.size()-1].getNbCol());
for (int i=0 ; i<vec_in.size() ; i++ )
vec_in[i] = i*0.015 ;
faust_vec<FPP> vec_out_faust, vec_out_mat;
faust_mat<FPP> full(params.data);
faust_timer t1;
t1.start();
vec_out_faust = faust * vec_in;
t1.stop();
cout << "temps multiplication faust-vector = " << t1.get_time() << "s." << endl;
faust_timer t2;
t2.start();
vec_in.multiplyLeft(full);
t2.stop();
cout << "temps multiplication matrix-vector = " << t2.get_time() << "s." << endl;
vec_out_mat = vec_in;
if (testMEG)
{
vec_out_faust.print_file("@FAUST_BIN_TEST_OUTPUT_DIR@/vec_out_MEG_faust.dat");
vec_out_mat.print_file("@FAUST_BIN_TEST_OUTPUT_DIR@/vec_out_MEG_mat.dat");
}
else
{
vec_out_faust.print_file("@FAUST_BIN_TEST_OUTPUT_DIR@/vec_out_hier_fact_faust.dat");
vec_out_mat.print_file("@FAUST_BIN_TEST_OUTPUT_DIR@/vec_out_hier_fact_mat.dat");
}
}
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