Commit aad7efb6 authored by Wen Yao Jin's avatar Wen Yao Jin
Browse files

modification

parent 954ea2e6
......@@ -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
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment