Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
J
Jeffrey_Wigger_Master_Project
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
Model registry
Operate
Environments
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
Semester-Projects
spring22
Jeffrey_Wigger_Master_Project
Commits
3189b6e9
Commit
3189b6e9
authored
2 years ago
by
Jeffrey Wigger
Browse files
Options
Downloads
Patches
Plain Diff
some fixes to WalkRouting
parent
6f89c99c
No related branches found
Branches containing commit
No related tags found
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
src/decentralizepy/communication/TCPRandomWalkRouting.py
+3
-2
3 additions, 2 deletions
src/decentralizepy/communication/TCPRandomWalkRouting.py
src/decentralizepy/datasets/CIFAR10.py
+2
-2
2 additions, 2 deletions
src/decentralizepy/datasets/CIFAR10.py
with
5 additions
and
4 deletions
src/decentralizepy/communication/TCPRandomWalkRouting.py
+
3
−
2
View file @
3189b6e9
...
...
@@ -561,7 +561,7 @@ class TCPRandomWalkRoutingInternal(TCPRandomWalkBase):
if
self
.
current_data
==
None
:
# have not yet received this rounds data
return
if
len
(
self
.
outgoing_request
)
!=
0
:
logging
.
debug
(
f
"
still have outgoing requests
{
len
(
self
.
outgoing_request
)
}
"
)
logging
.
debug
(
f
"
still have outgoing requests
{
self
.
outgoing_request
}
"
)
return
if
len
(
self
.
future_neighbours
.
get
(
self
.
current_round
,
[]))
!=
0
:
logging
.
debug
(
...
...
@@ -649,7 +649,7 @@ class TCPRandomWalkRoutingInternal(TCPRandomWalkBase):
self
.
send
(
sender
,
self
.
current_data
)
# messaging is tcp based so this should always arrive after helo
elif
round
==
self
.
current_round
+
1
:
# they are ahead
elif
round
>
self
.
current_round
:
# they are ahead
self
.
future_neighbours
.
setdefault
(
round
,
[]).
append
((
sender
,
False
))
logging
.
info
(
f
"
Added
{
sender
}
to future neighbors
"
)
# we conntact them in the next local round
...
...
@@ -812,6 +812,7 @@ class TCPRandomWalkRoutingInternal(TCPRandomWalkBase):
f
"
Response to our disconnect request for
{
sender
}
with round
{
bye
[
1
]
}
"
)
else
:
# this goodbye was not initiated by us
logging
.
debug
(
f
"
sender
{
sender
}
not in outgoing byes
"
)
all_to_be_removed
=
self
.
this_round_bye
.
union
(
set
(
self
.
future_byes
.
keys
())
)
...
...
This diff is collapsed.
Click to expand it.
src/decentralizepy/datasets/CIFAR10.py
+
2
−
2
View file @
3189b6e9
...
...
@@ -210,7 +210,7 @@ class CIFAR10(Dataset):
count
+=
1
_
,
predictions
=
torch
.
max
(
outputs
,
1
)
for
label
,
prediction
in
zip
(
labels
,
predictions
):
logging
.
debug
(
"
{} predicted as {}
"
.
format
(
label
,
prediction
))
#
logging.debug("{} predicted as {}".format(label, prediction))
if
label
==
prediction
:
correct_pred
[
label
]
+=
1
total_correct
+=
1
...
...
@@ -224,7 +224,7 @@ class CIFAR10(Dataset):
accuracy
=
100
*
float
(
value
)
/
total_pred
[
key
]
else
:
accuracy
=
100.0
logging
.
debug
(
"
Accuracy for class {} is: {:.1f} %
"
.
format
(
key
,
accuracy
))
#
logging.debug("Accuracy for class {} is: {:.1f} %".format(key, accuracy))
accuracy
=
100
*
float
(
total_correct
)
/
total_predicted
loss_val
=
loss_val
/
count
...
...
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