Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
SaCS
Semester-Projects-Spring22
decentralizepy-sgx
Commits
e4f866f0
Commit
e4f866f0
authored
Jun 13, 2022
by
Paul Nadal
💻
Browse files
remove tests
parent
7bba867b
Changes
1
Hide whitespace changes
Inline
Side-by-side
src/decentralizepy/sharing/Sharing.py
View file @
e4f866f0
import
json
import
logging
from
collections
import
deque
import
time
import
numpy
import
torch
...
...
@@ -153,8 +152,6 @@ class Sharing:
)
)
start
=
time
.
time
()
logging
.
info
(
"Starting model averaging after receiving from all neighbors"
)
total
=
dict
()
weight_total
=
0
...
...
@@ -175,9 +172,6 @@ class Sharing:
for
key
,
value
in
self
.
model
.
state_dict
().
items
():
total
[
key
]
+=
(
1
-
weight_total
)
*
value
# Metro-Hastings
end
=
time
.
time
()
logging
.
info
(
"Average execution time : "
+
str
(
end
-
start
)
+
" seconds"
)
self
.
model
.
load_state_dict
(
total
)
logging
.
info
(
"Model averaging complete"
)
...
...
Write
Preview
Supports
Markdown
0%
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!
Cancel
Please
register
or
sign in
to comment