Skip to content
Snippets Groups Projects
Commit 37c39c35 authored by Jeffrey Wigger's avatar Jeffrey Wigger
Browse files

Measuring the metadata correctly

parent 3dc5b174
No related branches found
No related tags found
1 merge request!12Fixes to the previous PR
......@@ -131,27 +131,23 @@ class TCP(Communication):
if self.compress:
if "indices" in data:
data["indices"] = self.compressor.compress(data["indices"])
meta_len = len(
pickle.dumps(data["indices"])
) # ONLY necessary for the statistics
else:
meta_len = 0
if "params" in data:
data["params"] = self.compressor.compress_float(data["params"])
assert "params" in data
data["params"] = self.compressor.compress_float(data["params"])
data_len = len(pickle.dumps(data["params"]))
output = pickle.dumps(data)
# the compressed meta data gets only a few bytes smaller after pickling
self.total_meta += meta_len
self.total_data += len(output) - meta_len
self.total_meta += len(output) - data_len
self.total_data += data_len
else:
output = pickle.dumps(data)
# centralized testing uses its own instance
if type(data) == dict:
if "indices" in data:
meta_len = len(pickle.dumps(data["indices"]))
else:
meta_len = 0
self.total_meta += meta_len
self.total_data += len(output) - meta_len
assert "params" in data
data_len = len(pickle.dumps(data["params"]))
self.total_meta += len(output) - data_len
self.total_data += data_len
return output
def decrypt(self, sender, data):
......
......@@ -19,7 +19,7 @@ class RandomAlpha(Wavelet):
model,
dataset,
log_dir,
alpha_list=[0.1, 0.2, 0.3, 0.4, 1.0],
alpha_list="[0.1, 0.2, 0.3, 0.4, 1.0]",
dict_ordered=True,
save_shared=False,
metadata_cap=1.0,
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment