Created
December 20, 2019 21:55
-
-
Save 3catz/a2ac5e0f47a8c29cb38fa8d5326a88ba to your computer and use it in GitHub Desktop.
Fuzzy Targets
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| D = reconstruct(s, dim = 22 * 2 + 5, tau = 1) | |
| Xs = [] | |
| Ys = [] | |
| for choice in np.repeat("random",3): | |
| X = D[:,:22 * 2] ; Y = D[:,-5:] | |
| if choice == 'random': | |
| import random | |
| y = [] | |
| for i in range(len(Y)): | |
| c = random.choice(Y[i,:]) | |
| y.append(c) | |
| Y = np.array(y) | |
| elif choice == "mean": | |
| Y = Y.mean(axis = -1) | |
| elif choice == 'median': | |
| Y = np.median(Y, axis = -1) | |
| Xs.append(X) ; Ys.append(Y) | |
| X = np.vstack(Xs) | |
| Y = np.hstack(Ys) | |
| print(X.shape, Y.shape) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment