Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
P
PySegCNN
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Deploy
Releases
Package registry
Container Registry
Model registry
Operate
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor 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
earth_observation_public
PySegCNN
Commits
54793cce
Commit
54793cce
authored
4 years ago
by
Frisinghelli Daniel
Browse files
Options
Downloads
Patches
Plain Diff
Added training-test ratio to NetworkTrainer call
parent
431b1d2c
No related branches found
No related tags found
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
sparcs/sparcs_00_config.py
+4
-4
4 additions, 4 deletions
sparcs/sparcs_00_config.py
sparcs/sparcs_02_dataset.py
+3
-2
3 additions, 2 deletions
sparcs/sparcs_02_dataset.py
with
7 additions
and
6 deletions
sparcs/sparcs_00_config.py
+
4
−
4
View file @
54793cce
...
@@ -16,8 +16,8 @@ import torch.optim as optim
...
@@ -16,8 +16,8 @@ import torch.optim as optim
# -----------------------------------------------------------------------------
# -----------------------------------------------------------------------------
# define path to working directory
# define path to working directory
wd
=
'
C:/Eurac/2020/
'
#
wd = 'C:/Eurac/2020/'
#
wd = '/mnt/CEPH_PROJECTS/cci_snow/dfrisinghelli/'
wd
=
'
/mnt/CEPH_PROJECTS/cci_snow/dfrisinghelli/
'
# path to the downloaded sparcs archive
# path to the downloaded sparcs archive
sparcs_archive
=
os
.
path
.
join
(
wd
,
'
_Datasets/Archives/l8cloudmasks.zip
'
)
sparcs_archive
=
os
.
path
.
join
(
wd
,
'
_Datasets/Archives/l8cloudmasks.zip
'
)
...
@@ -40,7 +40,7 @@ tile_size = 125
...
@@ -40,7 +40,7 @@ tile_size = 125
seed
=
0
seed
=
0
# (ttratio * 100) % of the dataset will be used for training and validation
# (ttratio * 100) % of the dataset will be used for training and validation
ttratio
=
0.8
ttratio
=
1
# (ttratio * tvratio) * 100 % will be used as the training dataset
# (ttratio * tvratio) * 100 % will be used as the training dataset
# (1 - ttratio * tvratio) * 100 % will be used as the validation dataset
# (1 - ttratio * tvratio) * 100 % will be used as the validation dataset
...
@@ -49,7 +49,7 @@ tvratio = 0.8
...
@@ -49,7 +49,7 @@ tvratio = 0.8
# define the batch size
# define the batch size
# determines how many samples of the dataset are processed until the weights
# determines how many samples of the dataset are processed until the weights
# of the network are updated
# of the network are updated
batch_size
=
1
6
batch_size
=
6
4
# -----------------------------------------------------------------------------
# -----------------------------------------------------------------------------
# -----------------------------------------------------------------------------
# -----------------------------------------------------------------------------
...
...
This diff is collapsed.
Click to expand it.
sparcs/sparcs_02_dataset.py
+
3
−
2
View file @
54793cce
...
@@ -20,7 +20,7 @@ from pytorch.train import NetworkTrainer
...
@@ -20,7 +20,7 @@ from pytorch.train import NetworkTrainer
from
pytorch.models
import
SegNet
from
pytorch.models
import
SegNet
from
sparcs.sparcs_00_config
import
(
sparcs_path
,
bands
,
tile_size
,
tvratio
,
from
sparcs.sparcs_00_config
import
(
sparcs_path
,
bands
,
tile_size
,
tvratio
,
filters
,
skip_connection
,
kwargs
,
filters
,
skip_connection
,
kwargs
,
loss_function
,
optimizer
,
lr
,
loss_function
,
optimizer
,
lr
,
ttratio
,
batch_size
,
seed
,
state_file
)
batch_size
,
seed
,
state_file
)
...
@@ -58,5 +58,6 @@ state_file = net.__class__.__name__ + state_file
...
@@ -58,5 +58,6 @@ state_file = net.__class__.__name__ + state_file
# instanciate NetworkTrainer class
# instanciate NetworkTrainer class
print
(
'
------------------------ Dataset split ---------------------------
'
)
print
(
'
------------------------ Dataset split ---------------------------
'
)
trainer
=
NetworkTrainer
(
net
,
dataset
,
loss_function
,
optimizer
,
trainer
=
NetworkTrainer
(
net
,
dataset
,
loss_function
,
optimizer
,
batch_size
=
batch_size
,
tvratio
=
tvratio
,
seed
=
seed
)
batch_size
=
batch_size
,
tvratio
=
tvratio
,
ttratio
=
ttratio
,
seed
=
seed
)
print
(
'
------------------------------------------------------------------
'
)
print
(
'
------------------------------------------------------------------
'
)
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