Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
D
DeepPPI
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Packages
Packages
Container Registry
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Florian RICHOUX
DeepPPI
Commits
f4a337ca
Commit
f4a337ca
authored
Jan 05, 2019
by
Florian RICHOUX
1
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add small FC
parent
e0d37b13
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
39 additions
and
1 deletion
+39
-1
main.py
keras/main.py
+4
-1
fc2-100_2dense.py
keras/models/fc2-100_2dense.py
+35
-0
No files found.
keras/main.py
View file @
f4a337ca
...
...
@@ -20,6 +20,7 @@ from models.lstm64x2_embed2_10dense_shared import LSTM64x2_Embed2_10Dense_S
from
models.lstm64x2_embed4_10dense_shared
import
LSTM64x2_Embed4_10Dense_S
from
models.fc6_embed3_2dense
import
FC6_Embed3_2Dense
from
models.fc2_2dense
import
FC2_2Dense
from
models
.
fc2
-
100_2
dense
import
FC2_100_2Dense
import
tensorflow
as
tf
from
keras
import
callbacks
...
...
@@ -90,6 +91,8 @@ def factory_model( model_name ):
return
FC6_Embed3_2Dense
(),
'fc6_embed3_2dense'
elif
model_name
==
'fc2_2dense'
:
return
FC2_2Dense
(),
'fc2_2dense'
elif
model_name
==
'fc2_100_2dense'
:
return
FC2_100_2Dense
(),
'fc2_100_2dense'
else
:
print
(
"Model unknown. Terminating."
)
sys
.
exit
(
1
)
...
...
@@ -121,7 +124,7 @@ def make_parser():
parser
.
add_argument
(
'-train'
,
type
=
str
,
help
=
'File containing the training set'
)
parser
.
add_argument
(
'-val'
,
type
=
str
,
help
=
'File containing the validation set'
)
parser
.
add_argument
(
'-test'
,
type
=
str
,
help
=
'File containing the test set'
)
parser
.
add_argument
(
'-model'
,
type
=
str
,
help
=
'choose among: lstm32_3conv3_2dense, lstm32_3conv3_2dense_shared, lstm32_3conv4_2dense_shared, lstm64_3conv3_2dense_shared, lstm64drop_3conv3_3dense_shared, lstm64x2_3conv3_10dense_shared, lstm64x2_embed2_10dense_shared, lstm64x2_embed4_10dense_shared, fc6_embed3_2dense, fc2_2dense'
)
parser
.
add_argument
(
'-model'
,
type
=
str
,
help
=
'choose among: lstm32_3conv3_2dense, lstm32_3conv3_2dense_shared, lstm32_3conv4_2dense_shared, lstm64_3conv3_2dense_shared, lstm64drop_3conv3_3dense_shared, lstm64x2_3conv3_10dense_shared, lstm64x2_embed2_10dense_shared, lstm64x2_embed4_10dense_shared, fc6_embed3_2dense, fc2_2dense
, fc2_100_2dense
'
)
parser
.
add_argument
(
'-epochs'
,
type
=
int
,
default
=
50
,
help
=
'Number of epochs [default: 50]'
)
parser
.
add_argument
(
'-batch'
,
type
=
int
,
default
=
64
,
help
=
'Batch size [default: 64]'
)
parser
.
add_argument
(
'-patience'
,
type
=
int
,
default
=
0
,
help
=
'Number of epochs before triggering the early stopping criterion [default: infinite patience]'
)
...
...
keras/models/fc2-100_2dense.py
0 → 100644
View file @
f4a337ca
from
keras.models
import
Model
from
keras
import
layers
from
keras
import
Input
import
numpy
as
np
import
tensorflow
as
tf
from
models.abstract_model
import
AbstractModel
class
FC2_100_2Dense
(
AbstractModel
):
def
__init__
(
self
):
super
()
.
__init__
()
def
get_model
(
self
):
input1
=
Input
(
shape
=
(
1166
,
20
,),
dtype
=
np
.
float32
,
name
=
'protein1'
)
protein1
=
layers
.
Flatten
()(
input1
)
protein1
=
layers
.
Dense
(
100
,
activation
=
'relu'
)(
protein1
)
protein1
=
layers
.
BatchNormalization
()(
protein1
)
protein1
=
layers
.
Dense
(
100
,
activation
=
'relu'
)(
protein1
)
protein1
=
layers
.
BatchNormalization
()(
protein1
)
input2
=
Input
(
shape
=
(
1166
,
20
,),
dtype
=
np
.
float32
,
name
=
'protein2'
)
protein2
=
layers
.
Flatten
()(
input2
)
protein2
=
layers
.
Dense
(
100
,
activation
=
'relu'
)(
protein2
)
protein2
=
layers
.
BatchNormalization
()(
protein2
)
protein2
=
layers
.
Dense
(
100
,
activation
=
'relu'
)(
protein2
)
protein2
=
layers
.
BatchNormalization
()(
protein2
)
head
=
layers
.
concatenate
([
protein1
,
protein2
],
axis
=-
1
)
head
=
layers
.
Dense
(
100
,
activation
=
'relu'
)(
head
)
head
=
layers
.
BatchNormalization
()(
head
)
head
=
layers
.
Dense
(
1
)(
head
)
output
=
layers
.
Activation
(
tf
.
nn
.
sigmoid
)(
head
)
model
=
Model
(
inputs
=
[
input1
,
input2
],
outputs
=
output
)
return
model
Florian RICHOUX
@richoux-f
mentioned in commit
2538795c
·
Jan 06, 2019
mentioned in commit
2538795c
mentioned in commit 2538795cb8f441ffd028d1cdb796566e926b73c1
Toggle commit list
Write
Preview
Markdown
is supported
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