Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 14 additions & 0 deletions configs/core/client/client_decavg_adam.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
client:
arguments:
include_myself: false
use_weighted_avg: false
local_model:
target: OVERRIDE_CLIENT_LOCAL_MODEL
target: DecAvgClient
training_engine:
target: TrainingEngine
arguments:
lr: 0.001
adam_weight_decay: 0.01
optimizer: AdamW
scheduler: cosine
14 changes: 14 additions & 0 deletions configs/core/client/client_decavg_self_adam.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
client:
arguments:
include_myself: true
use_weighted_avg: false
local_model:
target: OVERRIDE_CLIENT_LOCAL_MODEL
target: DecAvgClient
training_engine:
target: TrainingEngine
arguments:
lr: 0.001
adam_weight_decay: 0.01
optimizer: AdamW
scheduler: cosine
14 changes: 14 additions & 0 deletions configs/core/client/client_decavg_self_weighted_adam.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
client:
arguments:
include_myself: true
use_weighted_avg: true
local_model:
target: OVERRIDE_CLIENT_LOCAL_MODEL
target: DecAvgClient
training_engine:
target: TrainingEngine
arguments:
lr: 0.001
adam_weight_decay: 0.01
optimizer: AdamW
scheduler: cosine
5 changes: 5 additions & 0 deletions dengine/config/builtins.py
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,11 @@ def get_config(name: str, default_path: str = ""):
class BUILTINS:

class CORE:

class CLIENT:
CLIENT_DECAVG_ADAM = get_config('client_decavg_adam.yml', 'configs/core/client/client_decavg_adam.yml')
CLIENT_DECAVG_SELF_ADAM = get_config('client_decavg_self_adam.yml', 'configs/core/client/client_decavg_self_adam.yml')
CLIENT_DECAVG_SELF_WEIGHTED_ADAM = get_config('client_decavg_self_weighted_adam.yml', 'configs/core/client/client_decavg_self_weighted_adam.yml')
CORE = get_config('core.yml', 'configs/core/core.yml')
CORE_CENTRALIZED = get_config('core_centralized.yml', 'configs/core/core_centralized.yml')

Expand Down
9 changes: 9 additions & 0 deletions dengine/graph/graph.py
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,15 @@ def get_weight(self, source, neighbor) -> float:
def neighbors(self, source) -> Sequence:
...

def nodes_sort_by_neigbors_count(self, reverse: bool = False) -> Sequence:
"""Return a new list containing all the nodes from the graph in ascending order of neighbors counts (hub last).
"""
return sorted(
self.nodes,
key=lambda _x: len(self.neighbors(_x)),
reverse=reverse
)


class DynamicGraph(Graph, ABC):
def __init__(self, *args, **kwargs):
Expand Down
Loading