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
Milos Vujasinovic
decentralizepy
Commits
0c1ab13e
Commit
0c1ab13e
authored
2 years ago
by
Milos Vujasinovic
Browse files
Options
Downloads
Patches
Plain Diff
Class name fix for SecureCompressedAggregation
parent
a21933e8
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
eval/testing_secure.py
+2
-2
2 additions, 2 deletions
eval/testing_secure.py
src/decentralizepy/node/SecureCompressedAggregation.py
+3
-3
3 additions, 3 deletions
src/decentralizepy/node/SecureCompressedAggregation.py
with
5 additions
and
5 deletions
eval/testing_secure.py
+
2
−
2
View file @
0c1ab13e
...
@@ -8,7 +8,7 @@ from torch import multiprocessing as mp
...
@@ -8,7 +8,7 @@ from torch import multiprocessing as mp
from
decentralizepy
import
utils
from
decentralizepy
import
utils
from
decentralizepy.graphs.Graph
import
Graph
from
decentralizepy.graphs.Graph
import
Graph
from
decentralizepy.mappings.Linear
import
Linear
from
decentralizepy.mappings.Linear
import
Linear
from
decentralizepy.node.SecureCompressedAggregato
p
n
import
SecureCompressedAggregato
p
n
from
decentralizepy.node.SecureCompressedAggregat
i
on
import
SecureCompressedAggregat
i
on
def
read_ini
(
file_path
):
def
read_ini
(
file_path
):
...
@@ -54,7 +54,7 @@ if __name__ == "__main__":
...
@@ -54,7 +54,7 @@ if __name__ == "__main__":
for
r
in
range
(
procs_per_machine
):
for
r
in
range
(
procs_per_machine
):
processes
.
append
(
processes
.
append
(
mp
.
Process
(
mp
.
Process
(
target
=
SecureCompressedAggregato
p
n
,
target
=
SecureCompressedAggregat
i
on
,
args
=
[
args
=
[
r
,
r
,
m_id
,
m_id
,
...
...
This diff is collapsed.
Click to expand it.
src/decentralizepy/node/SecureCompressedAggregato
p
n.py
→
src/decentralizepy/node/SecureCompressedAggregat
i
on.py
+
3
−
3
View file @
0c1ab13e
...
@@ -84,7 +84,7 @@ def temp_seed(seed):
...
@@ -84,7 +84,7 @@ def temp_seed(seed):
finally
:
finally
:
np
.
random
.
set_state
(
state
)
np
.
random
.
set_state
(
state
)
class
SecureCompressedAggregato
p
n
(
DPSGDNode
):
class
SecureCompressedAggregat
i
on
(
DPSGDNode
):
"""
"""
This class defines the node for secure compressed aggregation
This class defines the node for secure compressed aggregation
...
@@ -226,7 +226,8 @@ class SecureCompressedAggregatopn(DPSGDNode):
...
@@ -226,7 +226,8 @@ class SecureCompressedAggregatopn(DPSGDNode):
def
generate_mask
(
self
,
seed
,
size
):
def
generate_mask
(
self
,
seed
,
size
):
with
temp_seed
(
seed
):
with
temp_seed
(
seed
):
return
torch
.
Tensor
(
np
.
random
.
uniform
(
1
,
10
,
size
=
size
))
# Figure out best distribution to add
return
torch
.
Tensor
(
np
.
random
.
normal
(
0
,
100000
,
size
=
size
))
def
run
(
self
):
def
run
(
self
):
"""
"""
...
@@ -244,7 +245,6 @@ class SecureCompressedAggregatopn(DPSGDNode):
...
@@ -244,7 +245,6 @@ class SecureCompressedAggregatopn(DPSGDNode):
for
iteration
in
range
(
self
.
iterations
):
for
iteration
in
range
(
self
.
iterations
):
logging
.
info
(
"
Starting training iteration: %d
"
,
iteration
)
logging
.
info
(
"
Starting training iteration: %d
"
,
iteration
)
print
(
"
Starting training iteration:
"
,
iteration
)
rounds_to_train_evaluate
-=
1
rounds_to_train_evaluate
-=
1
rounds_to_test
-=
1
rounds_to_test
-=
1
...
...
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