Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
D
decentralizepy
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD 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
SaCS
decentralizepy
Commits
cef92565
Commit
cef92565
authored
3 years ago
by
Rishi Sharma
Browse files
Options
Downloads
Patches
Plain Diff
GradientAccumulator migration to steps
parent
0d50bc39
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
src/decentralizepy/training/GradientAccumulator.py
+3
-3
3 additions, 3 deletions
src/decentralizepy/training/GradientAccumulator.py
src/decentralizepy/training/Training.py
+1
-1
1 addition, 1 deletion
src/decentralizepy/training/Training.py
with
4 additions
and
4 deletions
src/decentralizepy/training/GradientAccumulator.py
+
3
−
3
View file @
cef92565
...
@@ -5,7 +5,7 @@ from decentralizepy.training.Training import Training
...
@@ -5,7 +5,7 @@ from decentralizepy.training.Training import Training
class
GradientAccumulator
(
Training
):
class
GradientAccumulator
(
Training
):
def
__init__
(
def
__init__
(
self
,
model
,
optimizer
,
loss
,
epochs_per_round
=
""
,
batch_size
=
""
,
shuffle
=
""
self
,
model
,
optimizer
,
loss
,
rounds
=
""
,
full_epochs
=
""
,
batch_size
=
""
,
shuffle
=
""
):
):
"""
"""
Constructor
Constructor
...
@@ -22,9 +22,9 @@ class GradientAccumulator(Training):
...
@@ -22,9 +22,9 @@ class GradientAccumulator(Training):
batch_size : int, optional
batch_size : int, optional
Number of items to learn over, in one batch
Number of items to learn over, in one batch
shuffle : bool
shuffle : bool
True if the dataset should be shuffled before training.
Not implemented yet! TODO
True if the dataset should be shuffled before training.
"""
"""
super
().
__init__
(
model
,
optimizer
,
loss
,
epochs_per_round
,
batch_size
,
shuffle
)
super
().
__init__
(
model
,
optimizer
,
loss
,
rounds
,
full_epochs
,
batch_size
,
shuffle
)
def
trainstep
(
self
,
data
,
target
):
def
trainstep
(
self
,
data
,
target
):
"""
"""
...
...
This diff is collapsed.
Click to expand it.
src/decentralizepy/training/Training.py
+
1
−
1
View file @
cef92565
...
@@ -37,7 +37,7 @@ class Training:
...
@@ -37,7 +37,7 @@ class Training:
batch_size : int, optional
batch_size : int, optional
Number of items to learn over, in one batch
Number of items to learn over, in one batch
shuffle : bool
shuffle : bool
True if the dataset should be shuffled before training.
Not implemented yet! TODO
True if the dataset should be shuffled before training.
"""
"""
self
.
model
=
model
self
.
model
=
model
self
.
optimizer
=
optimizer
self
.
optimizer
=
optimizer
...
...
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