Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
MAGE Multiview Artificial Generation Engine
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
Container registry
Model registry
Operate
Environments
Monitor
Incidents
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
dev
MAGE Multiview Artificial Generation Engine
Commits
4e11c380
Commit
4e11c380
authored
4 years ago
by
Baptiste Bauvin
Browse files
Options
Downloads
Patches
Plain Diff
Added fig
parent
27743786
No related branches found
No related tags found
No related merge requests found
Pipeline
#5285
passed
4 years ago
Stage: test
Stage: deploy
Changes
2
Pipelines
1
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
docs/source/_static/fig_rec.png
+0
-0
0 additions, 0 deletions
docs/source/_static/fig_rec.png
multiview_generator/multiple_sub_problems.py
+6
-8
6 additions, 8 deletions
multiview_generator/multiple_sub_problems.py
with
6 additions
and
8 deletions
docs/source/_static/fig_rec.png
0 → 100644
+
0
−
0
View file @
4e11c380
243 KiB
This diff is collapsed.
Click to expand it.
multiview_generator/multiple_sub_problems.py
+
6
−
8
View file @
4e11c380
...
@@ -65,7 +65,6 @@ class MultiViewSubProblemsGenerator:
...
@@ -65,7 +65,6 @@ class MultiViewSubProblemsGenerator:
if
config_file
is
not
None
:
if
config_file
is
not
None
:
args
=
get_config_from_file
(
config_file
)
args
=
get_config_from_file
(
config_file
)
self
.
__init__
(
**
args
)
self
.
__init__
(
**
args
)
print
(
self
.
sub_problem_types
)
else
:
else
:
self
.
rs
=
init_random_state
(
random_state
)
self
.
rs
=
init_random_state
(
random_state
)
self
.
n_samples
=
n_samples
self
.
n_samples
=
n_samples
...
@@ -264,8 +263,6 @@ class MultiViewSubProblemsGenerator:
...
@@ -264,8 +263,6 @@ class MultiViewSubProblemsGenerator:
(
self
.
n_examples_per_class
[
class_index
]
*
(
1
-
confusion
)).
astype
(
(
self
.
n_examples_per_class
[
class_index
]
*
(
1
-
confusion
)).
astype
(
int
)
int
)
for
class_index
,
confusion
in
enumerate
(
self
.
error_matrix
)]
for
class_index
,
confusion
in
enumerate
(
self
.
error_matrix
)]
print
(
self
.
n_well_described
)
print
(
2000
*
0.6
/
3
)
self
.
n_misdescribed
=
[(
self
.
n_examples_per_class
[
class_index
]
-
self
.
n_misdescribed
=
[(
self
.
n_examples_per_class
[
class_index
]
-
self
.
n_well_described
[
class_index
])
self
.
n_well_described
[
class_index
])
for
class_index
in
range
(
self
.
n_classes
)]
for
class_index
in
range
(
self
.
n_classes
)]
...
@@ -391,20 +388,21 @@ class MultiViewSubProblemsGenerator:
...
@@ -391,20 +388,21 @@ class MultiViewSubProblemsGenerator:
return
self
.
n_samples
*
self
.
latent_size_mult
return
self
.
n_samples
*
self
.
latent_size_mult
def
_gen_indices_for
(
self
,
name
=
"
redundancy
"
,
error_mat_fun
=
lambda
x
:
1
-
x
):
def
_gen_indices_for
(
self
,
name
=
"
redundancy
"
,
error_mat_fun
=
lambda
x
:
1
-
x
):
quantit
y
=
getattr
(
self
,
name
)
quantit
ies
=
getattr
(
self
,
name
)
indices
=
getattr
(
self
,
name
+
"
_indices
"
)
indices
=
getattr
(
self
,
name
+
"
_indices
"
)
if
(
np
.
repeat
(
quantit
y
,
self
.
n_views
,
if
(
np
.
repeat
(
quantit
ies
,
self
.
n_views
,
axis
=
1
)
>
error_mat_fun
(
self
.
error_matrix
)).
any
():
axis
=
1
)
>
error_mat_fun
(
self
.
error_matrix
)).
any
():
raise
ValueError
(
raise
ValueError
(
"
{} ({}) must be at least equal to the lowest accuracy rate
"
"
{} ({}) must be at least equal to the lowest accuracy rate
"
"
of all the confusion matrix ({}).
"
.
format
(
name
,
"
of all the confusion matrix ({}).
"
.
format
(
name
,
quantit
y
,
np
.
min
(
error_mat_fun
(
self
.
error_matrix
),
axis
=
1
)))
quantit
ies
,
np
.
min
(
error_mat_fun
(
self
.
error_matrix
),
axis
=
1
)))
else
:
else
:
for
class_index
,
redundanc
y
in
enumerate
(
quantit
y
):
for
class_index
,
quantit
y
in
enumerate
(
quantit
ies
):
indices
[
class_index
]
=
self
.
rs
.
choice
(
indices
[
class_index
]
=
self
.
rs
.
choice
(
self
.
available_init_indices
[
class_index
],
self
.
available_init_indices
[
class_index
],
size
=
int
(
size
=
int
(
self
.
n_examples_per_class
[
class_index
]
*
redundancy
))
self
.
n_examples_per_class
[
class_index
]
*
quantity
),
replace
=
False
)
self
.
_update_example_indices
(
self
.
_update_example_indices
(
indices
[
class_index
],
name
,
indices
[
class_index
],
name
,
class_index
)
class_index
)
...
...
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