PyRegistry
A windows registry script generator written in pure Python.
Features
Compatibility. FederatedCore can work seamlessly with mainstream deep learning frameworks, e.g., PyTorch and Tensorflow.
Modular. The code of the algorithm module can be used individually.
Easy to use. Retrofit existing code to data parallelism with no more than 100 lines code.
Support
Attributes |
Value |
|---|---|
Framework |
Pytorch, Tensorflow |
Engine |
parallelism, sequence |
Dataset |
label distribution, quality distribution |
Topology |
parameter server, gossip, all reduce |
Communication |
queue, TCP |
QuickStart
Install m3u8_To_MP4 via pip
# via pypi.org
python -m pip install federatedcore
# first clone project, and install.
git clone https://github.com/songs18/FederatedCore.git
python -m pip install ./FederatedCore
A small example (FedAvg)
Implement FedAvg in fewer than 100 lines.
(/examples/FedAvg/federated_average.py)
def run(num_nodes, has_server):
def build_host_ids():
if has_server:
return [i for i in range(num_nodes + 1)]
else:
return [i for i in range(num_nodes)]
def build_func_libs():
func_libs = {
'train_dataset' : 'self_contained_dnn', # load_train_dataset,
'test_dataset' : 'self_contained_dnn', # load_test_dataset,
'model' : 'self_contained_dnn', # get_model,
'loss' : 'self_contained_dnn', # get_loss,
'optimizer' : 'self_contained_dnn', # get_optimizer,
'metric_loss' : 'self_contained_dnn', # get_metric_loss,
'metric_acc' : 'self_contained_dnn', # get_metric_acc,
'train_step' : 'self_contained_dnn', # get_train_step,
'test_step' : 'self_contained_dnn', # get_test_step,
'aggregation_func': average_parameters,
}
return func_libs
def build_linkers():
node_inboxes = queuer.node_inbox(num_nodes + 1)
linkers = list()
for host_id in range(num_nodes):
linker = queuer.LocalQueue(host_id, node_inboxes)
linkers.append(linker)
if has_server:
linker = queuer.LocalQueue(num_nodes, node_inboxes)
linkers.append(linker)
return linkers
def build_execution_plans():
execution_plans = ExecutionPlanTemplate.client_train * 5
execution_plans = [[[c, {}] for c in execution_plans] for _ in range(num_nodes)]
if has_server:
server_execution_plan = ExecutionPlanTemplate.server_init + ExecutionPlanTemplate.server_sync_train * 5
server_execution_plan.pop(-1)
server_execution_plan = [[s, {'iteration': 3}] for s in server_execution_plan]
execution_plans.append(server_execution_plan)
return execution_plans
host_ids = build_host_ids()
func_libs = build_func_libs()
linkers = build_linkers()
execution_plans = build_execution_plans()
parallelism.run_parallel(host_ids, func_libs, linkers, execution_plans)
def main():
num_nodes = 2
generate_topology(num_nodes)
split_dataset(num_nodes)
build_host(num_nodes)
run(num_nodes, True)
if __name__ == '__main__':
main()
Release files for pywinregistry 0.0.1
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| pywinregistry-0.0.1.tar.gz | 4.3 kB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| pywinregistry-0.0.1-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 8.3 kB
Release files / pywinregistry-0.0.1.tar.gz
| Download URL | pywinregistry-0.0.1.tar.gz |
|---|---|
| Size | 4.3 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
b30ad4919e862235c9a4bb71fe5f2c8c87e2a537dc5552d3156350b9309a6039
|
|
BLAKE2b-256 checksum How to use checksums |
e980663faf4f0f87a7efa995a242ba9710a3900942e7d61046a4de6b126e2c1c
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/4.0.1 CPython/3.9.13
|
Release files / pywinregistry-0.0.1-py3-none-any.whl
| Download URL | pywinregistry-0.0.1-py3-none-any.whl |
|---|---|
| Size | 4.1 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
f66bd798bbdf086e0d3769e383bdb2563e6653601bf97988e3bf52b18af1d86f
|
|
BLAKE2b-256 checksum How to use checksums |
036905d8e2dac5e668bc241c8936407f7e2948fe86a71e5cbac8c278c4154bd1
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/4.0.1 CPython/3.9.13
|