So essentially what I am trying to do is generate a vector with components that are each bound within a specific and relative max and a min. So what I have the program doing right now is looking through each element of several vectors, finding the max and min, and then generating a value within that range.The only issue is this piece of the program takes forever to run, since the vectors are very large.
Numba sped it up a bit but not enough to be practical. So im wondering if there is either a pre-existing function/library that can do this that is a lot more optimized, or a better way to do it overall.
@numba.jit(target='cpu', nopython=False, parallel=True)
def rand_Vector(size, keys):
array = []
for g in trange((size), desc='Vectors_Elements:'):
min = (embeddings[keys[0]])[g]
max = (embeddings[keys[0]])[g]
for key in keys:
item = (embeddings[key])[g]
if(item < min):
min = item
if(item > max):
max = item
array.append(random.uniform(min, max))
return array