Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
S
SENSE-PPI
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Konstantin Volzhenin
SENSE-PPI
Commits
b2c43f05
Commit
b2c43f05
authored
Jun 21, 2024
by
Konstantin Volzhenin
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
0.7.2 Checkpoint loading in train
parent
8ec564c9
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
9 additions
and
1 deletions
+9
-1
__init__.py
senseppi/__init__.py
+1
-1
train.py
senseppi/commands/train.py
+8
-0
No files found.
senseppi/__init__.py
View file @
b2c43f05
__version__
=
"0.7.
1
"
__version__
=
"0.7.
2
"
__author__
=
"Konstantin Volzhenin"
from
.
import
model
,
commands
,
esm2_model
,
dataset
,
utils
,
network_utils
...
...
senseppi/commands/train.py
View file @
b2c43f05
...
...
@@ -19,6 +19,11 @@ def main(params):
model
=
SensePPIModel
(
params
)
if
params
.
device
==
'gpu'
and
params
.
ckpt_path
is
not
None
:
checkpoint
=
torch
.
load
(
params
.
ckpt_path
)
model
.
load_state_dict
(
checkpoint
[
'state_dict'
])
print
(
'checkpoint loaded'
)
model
.
load_data
(
dataset
=
dataset
,
valid_size
=
params
.
valid_size
)
train_set
=
model
.
train_dataloader
()
val_set
=
model
.
val_dataloader
()
...
...
@@ -63,6 +68,9 @@ def add_args(parser):
train_args
.
add_argument
(
"--early_stop"
,
type
=
int
,
default
=
10
,
help
=
"Number of epochs to wait before stopping the training "
"(tracking is done with validation loss). By default, the is no early stopping."
)
train_args
.
add_argument
(
"--ckpt_path"
,
type
=
str
,
default
=
None
,
help
=
"Path to the checkpoint to load the model from. Can be used for transfer learning. "
"Loads the model only for GPU training."
)
parser
=
SensePPIModel
.
add_model_specific_args
(
parser
)
...
...
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