Toggle navigation
Toggle navigation
This project
Loading...
Sign in
Ludovic PLATON
/
IRSOM
Go to a project
Toggle navigation
Toggle navigation pinning
Projects
Groups
Snippets
Help
Project
Activity
Repository
Pipelines
Graphs
Issues
0
Merge Requests
0
Wiki
Network
Create a new issue
Builds
Commits
Authored by
Ludovic PLATON
2018-04-13 08:44:31 +0000
Browse Files
Options
Browse Files
Download
Email Patches
Plain Diff
Commit
3b5afa1e61384c739d1599f8c3f2904b52d9c000
3b5afa1e
1 parent
4f7fa509
Fix type in train script
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
7 additions
and
8 deletions
scripts/SLSOM/util.py
scripts/train.py
scripts/SLSOM/util.py
View file @
3b5afa1
...
...
@@ -28,7 +28,7 @@ Import data
'''
def
import_ncRNA
(
path
):
file_order
=
[
"CB.txt"
,
"ORF.txt"
,
"KMER3.txt"
,
"KMER4.txt"
,
"KMER5.txt"
]
#,"KMER6.txt"]
file_order
=
[
"CB.txt"
,
"ORF.txt"
,
"KMER3.txt"
,
"KMER4.txt"
,
"KMER5.txt"
]
df_raw
=
[]
with
ThreadPoolExecutor
(
max_workers
=
5
)
as
tp
:
for
x
in
file_order
:
...
...
@@ -88,7 +88,6 @@ def combination(vector_values):
idx_values
[
i
]
=
0
if
idx_values
[
i
]
==
nb_values
[
i
]
else
idx_values
[
i
]
NUC_ORDER
=
[
"A"
,
"C"
,
"T"
,
"G"
]
def
plot_weights
(
units
,
m
,
n
,
name
):
features
=
[
[
"Position "
+
x
for
x
in
NUC_ORDER
]
+
[
"Composition "
+
x
for
x
in
NUC_ORDER
]
+
[
"GC composition"
],
...
...
@@ -108,18 +107,18 @@ def plot_weights(units,m,n,name):
dico
.
append
({
"x"
:
i
,
"y"
:
j
,
"x2"
:
k
,
"y2"
:
units
[
idx
,
features_pos
[
l
][
k
]],
"Name"
:
features
[
l
][
k
]})
df
=
pd
.
DataFrame
(
dico
)
p
=
ggplot
(
df
,
aes
(
x
=
"x2"
,
y
=
"y2"
))
p
+=
geom_point
(
aes
(
color
=
"Name"
))
p
+=
geom_line
()
p
+=
geom_point
(
aes
(
color
=
"Name"
),
size
=
2.0
)
p
+=
facet_grid
(
"x ~ y "
)
p
+=
xlab
(
""
)
p
+=
ylab
(
""
)
p
+=
guides
(
color
=
guide_legend
(
override_aes
=
{
"size"
:
4
}))
p
+=
theme
(
legend_text
=
element_text
(
size
=
20
),
legend_title
=
element_text
(
size
=
20
),
axis_text_x
=
element_blank
()
legend_text
=
element_text
(
size
=
10
),
legend_title
=
element_text
(
size
=
12
),
axis_text_x
=
element_blank
(),
legend_position
=
"top"
)
check_dir_file
(
name
)
p
.
save
(
name
+
features_names
[
l
]
+
".png"
,
width
=
15
,
height
=
10
)
def
plot_density
(
y
,
proba
,
name
):
...
...
scripts/train.py
View file @
3b5afa1
...
...
@@ -37,7 +37,7 @@ def main():
map_size_n
=
int
(
arguments
[
"--dim1"
])
if
not
arguments
[
"--dim0"
]
is
None
else
10
batch_size
=
int
(
arguments
[
"--batch_size"
])
if
not
arguments
[
"--batch_size"
]
is
None
else
100
penality
=
float
(
arguments
[
"--penality"
])
if
not
arguments
[
"--penality"
]
is
None
else
0.001
alpha
=
float
(
argument
[
"--alpha"
])
if
not
argument
[
"--alpha"
]
is
None
else
0.5
alpha
=
float
(
argument
s
[
"--alpha"
])
if
not
arguments
[
"--alpha"
]
is
None
else
0.5
verbose
=
arguments
[
"--verbose"
]
#Compute features
...
...
Please
register
or
login
to post a comment