MCPcopy Create free account
hub / github.com/HazyResearch/spacetime / get_plotting_samples

Function get_plotting_samples

train/evaluate.py:55–70  ·  view source on GitHub ↗

y = {'true': torch.stack(total_y_true) 'pred': torch.stack(total_y_pred), 'true_informer': total_y_true_informer 'pred_informer': total_y_pred_informer} Assumes that samples are not shuffled, strided

(y)

Source from the content-addressed store, hash-verified

53
54
55def get_plotting_samples(y):
56 """
57 y = {'true': torch.stack(total_y_true)
58 'pred': torch.stack(total_y_pred),
59 'true_informer': total_y_true_informer
60 'pred_informer': total_y_pred_informer}
61
62 Assumes that samples are not shuffled, strided
63 """
64 samples = {}
65 for k, _y in y.items():
66 if 'informer' not in k and 'true' not in k: # Only plot raw-scale samples
67 samples[k] = average_horizons(_y)
68 elif k == 'true':
69 samples[k] = average_horizons(_y)
70 return samples
71
72
73def average_horizons(y):

Callers 1

plot_forecastsFunction · 0.85

Calls 1

average_horizonsFunction · 0.85

Tested by

no test coverage detected