Skip to content

Instantly share code, notes, and snippets.

@3catz
Created December 20, 2019 21:55
Show Gist options
  • Select an option

  • Save 3catz/a2ac5e0f47a8c29cb38fa8d5326a88ba to your computer and use it in GitHub Desktop.

Select an option

Save 3catz/a2ac5e0f47a8c29cb38fa8d5326a88ba to your computer and use it in GitHub Desktop.
Fuzzy Targets
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