Skip to content
Snippets Groups Projects
Commit aad7efb6 authored by Wen Yao Jin's avatar Wen Yao Jin
Browse files

modification

parent 954ea2e6
No related branches found
No related tags found
No related merge requests found
......@@ -18,11 +18,12 @@ def data_gen( dimen, numGau, n_samples, mu, std):
return data
def vector_gen(dimen, magnitude = None, normalize = True):
#randomly generate vectors with option to adjust magnitude and normalize center to 0
if magnitude==None:
magnitude = np.ones(dimen)
rand = np.random.rand(dimen)
if normalize:
return (rand-0.5)*2*magnitude
return (rand-0.5)*magnitude
else :
return rand*magnitude
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment