Skip to content
GitLab
Menu
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
dev
MAGE Multiview Artificial Generation Engine
Commits
4e11c380
Commit
4e11c380
authored
Jul 06, 2020
by
Baptiste Bauvin
Browse files
Added fig
parent
27743786
Pipeline
#5285
passed with stages
in 2 minutes and 46 seconds
Changes
2
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
docs/source/_static/fig_rec.png
0 → 100644
View file @
4e11c380
243 KB
multiview_generator/multiple_sub_problems.py
View file @
4e11c380
...
...
@@ -65,7 +65,6 @@ class MultiViewSubProblemsGenerator:
if
config_file
is
not
None
:
args
=
get_config_from_file
(
config_file
)
self
.
__init__
(
**
args
)
print
(
self
.
sub_problem_types
)
else
:
self
.
rs
=
init_random_state
(
random_state
)
self
.
n_samples
=
n_samples
...
...
@@ -264,8 +263,6 @@ class MultiViewSubProblemsGenerator:
(
self
.
n_examples_per_class
[
class_index
]
*
(
1
-
confusion
)).
astype
(
int
)
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_well_described
[
class_index
])
for
class_index
in
range
(
self
.
n_classes
)]
...
...
@@ -391,20 +388,21 @@ class MultiViewSubProblemsGenerator:
return
self
.
n_samples
*
self
.
latent_size_mult
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"
)
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
():
raise
ValueError
(
"{} ({}) must be at least equal to the lowest accuracy rate "
"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
:
for
class_index
,
redundanc
y
in
enumerate
(
quantit
y
):
for
class_index
,
quantit
y
in
enumerate
(
quantit
ies
):
indices
[
class_index
]
=
self
.
rs
.
choice
(
self
.
available_init_indices
[
class_index
],
size
=
int
(
self
.
n_examples_per_class
[
class_index
]
*
redundancy
))
self
.
n_examples_per_class
[
class_index
]
*
quantity
),
replace
=
False
)
self
.
_update_example_indices
(
indices
[
class_index
],
name
,
class_index
)
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment