Closed zhuy16 closed 4 years ago
The Loader object takes an optional second argument "labels", so you can pass in your labels as a numpy array when creating the loader like this: load = Loader(x, labels, shuffle=True) and give that object to saucie.train, which will automatically detect the labels.
Hope that helps!
Great! Thanks!
From: Matt Amodio notifications@github.com Reply-To: KrishnaswamyLab/SAUCIE reply@reply.github.com Date: Monday, June 29, 2020 at 1:09 PM To: KrishnaswamyLab/SAUCIE SAUCIE@noreply.github.com Cc: "Zhu, Yunhua (NIH/NIAID) [C]" yunhua.zhu@nih.gov, Author author@noreply.github.com Subject: Re: [KrishnaswamyLab/SAUCIE] How should I "provide each point's batch as a label"? (#29)
Closed #29https://github.com/KrishnaswamyLab/SAUCIE/issues/29.
— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHubhttps://github.com/KrishnaswamyLab/SAUCIE/issues/29#event-3493707357, or unsubscribehttps://github.com/notifications/unsubscribe-auth/ANC3VBGNCYEUUOODYIJIIP3RZDDENANCNFSM4OKJKJYA.
I am stacked at batch correction, please advise how to proceed here, appreciate!
My code:
x1 = np.concatenate([np.random.uniform(-3, -2, (1000, 40)), np.random.uniform(2, 3, (1000, 40))], axis=0) x2 = np.concatenate([np.random.uniform(-3, -2, (1000, 40)), np.random.uniform(2, 3, (1000, 40))], axis=0) x = np.concatenate([x1,x2],axis=0) load = SAUCIE.Loader(x, shuffle=False) saucie = SAUCIE.SAUCIE(x.shape[1], lambda_b=.1) labels=[0 for i in range(2000)]+[1 for i in range(2000)] saucie.batches=np.array(labels) saucie.train(load, 100)
Error:
Exception Traceback (most recent call last)