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
8a23b723
Commit
8a23b723
authored
8 years ago
by
Nicolas Bellot
Committed by
hhakim
2 years ago
Browse files
Options
Downloads
Patches
Plain Diff
demo fact hadamard bug solved
parent
526d3b78
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/Hadamard_factorization/demo_fact_hadamard.m
+18
-17
18 additions, 17 deletions
misc/demo/Hadamard_factorization/demo_fact_hadamard.m
with
18 additions
and
17 deletions
misc/demo/Hadamard_factorization/demo_fact_hadamard.m
+
18
−
17
View file @
8a23b723
...
@@ -54,23 +54,23 @@ M = log2(n);
...
@@ -54,23 +54,23 @@ M = log2(n);
%% Setting of the parameters
%% Setting of the parameters
params
.
nrow
=
n
;
params
_hadamard
.
nrow
=
n
;
params
.
ncol
=
n
;
params
_hadamard
.
ncol
=
n
;
params
.
nfacts
=
M
;
params
_hadamard
.
nfacts
=
M
;
params
.
cons
=
cell
(
2
,
M
-
1
);
params
_hadamard
.
cons
=
cell
(
2
,
M
-
1
);
for
j
=
1
:
M
-
1
for
j
=
1
:
M
-
1
params
.
cons
{
1
,
j
}
=
{
'splincol'
,
2
,
n
,
n
};
params
_hadamard
.
cons
{
1
,
j
}
=
{
'splincol'
,
2
,
n
,
n
};
params
.
cons
{
2
,
j
}
=
{
'splincol'
,
n
/
2
^
j
,
n
,
n
};
params
_hadamard
.
cons
{
2
,
j
}
=
{
'splincol'
,
n
/
2
^
j
,
n
,
n
};
end
end
params
.
niter1
=
30
;
params
_hadamard
.
niter1
=
30
;
params
.
niter2
=
30
;
params
_hadamard
.
niter2
=
30
;
params
.
update_way
=
1
;
params
_hadamard
.
update_way
=
1
;
params
.
verbose
=
0
;
params
_hadamard
.
verbose
=
0
;
hadamard_faust
=
faust_decompose
(
matrix
,
params
);
hadamard_faust
=
faust_decompose
(
matrix
,
params
_hadamard
);
Xhat
=
full
(
hadamard_faust
);
Xhat
=
full
(
hadamard_faust
);
relative_error
=
norm
(
matrix
-
Xhat
)/
norm
(
matrix
);
relative_error
=
norm
(
matrix
-
Xhat
)/
norm
(
matrix
);
fprintf
([
'\n\n relative error between hadamard matrix and its transform : '
num2str
(
relative_error
)
'\n'
]);
fprintf
([
'\n\n relative error between hadamard matrix and its transform : '
num2str
(
relative_error
)
'\n'
]);
...
@@ -119,7 +119,7 @@ format_fig='-dpng';
...
@@ -119,7 +119,7 @@ format_fig='-dpng';
fighandle
=
figure
;
fighandle
=
figure
;
hold
on
;
hold
on
;
subplot
(
1
,
params
.
nfacts
+
1
,
1
);
subplot
(
1
,
params
_hadamard
.
nfacts
+
1
,
1
);
imagesc
(
Xhat
);
axis
square
imagesc
(
Xhat
);
axis
square
set
(
gca
,
'xtick'
,[],
'ytick'
,[])
set
(
gca
,
'xtick'
,[],
'ytick'
,[])
...
@@ -129,8 +129,8 @@ for i=1:M
...
@@ -129,8 +129,8 @@ for i=1:M
facts
{
i
}
=
get_fact
(
hadamard_faust
,
i
);
facts
{
i
}
=
get_fact
(
hadamard_faust
,
i
);
end
end
for
kk
=
1
:
params
.
nfacts
for
kk
=
1
:
params
_hadamard
.
nfacts
subplot
(
1
,
params
.
nfacts
+
1
,
1
+
kk
)
subplot
(
1
,
params
_hadamard
.
nfacts
+
1
,
1
+
kk
)
imagesc
(
facts
{
kk
});
axis
square
imagesc
(
facts
{
kk
});
axis
square
set
(
gca
,
'xtick'
,[],
'ytick'
,[])
set
(
gca
,
'xtick'
,[],
'ytick'
,[])
end
end
...
@@ -142,13 +142,13 @@ print(figure_name, format_fig);
...
@@ -142,13 +142,13 @@ print(figure_name, format_fig);
fighandle
=
figure
;
fighandle
=
figure
;
hold
on
;
hold
on
;
subplot
(
1
,
params
.
nfacts
+
1
,
1
);
subplot
(
1
,
params
_hadamard
.
nfacts
+
1
,
1
);
imagesc
(
Xhat
);
axis
square
imagesc
(
Xhat
);
axis
square
set
(
gca
,
'xtick'
,[],
'ytick'
,[])
set
(
gca
,
'xtick'
,[],
'ytick'
,[])
for
kk
=
1
:
params
.
nfacts
for
kk
=
1
:
params
_hadamard
.
nfacts
subplot
(
1
,
params
.
nfacts
+
1
,
1
+
kk
)
subplot
(
1
,
params
_hadamard
.
nfacts
+
1
,
1
+
kk
)
spy
(
facts
{
kk
});
axis
square
spy
(
facts
{
kk
});
axis
square
set
(
gca
,
'xtick'
,[],
'ytick'
,[])
set
(
gca
,
'xtick'
,[],
'ytick'
,[])
end
end
...
@@ -160,3 +160,4 @@ print(figure_name, format_fig);
...
@@ -160,3 +160,4 @@ print(figure_name, format_fig);
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