DebasishDhal99
commited on
Commit
·
54dcd4b
1
Parent(s):
0e60a05
Random seed bug
Browse files
app.py
CHANGED
@@ -12,6 +12,8 @@ def generate_random_walk(iters, step_size = 1, random_seed = None):
|
|
12 |
|
13 |
if random_seed is None:
|
14 |
random_seed = random.randint(1, 100000)
|
|
|
|
|
15 |
|
16 |
def distance_from_start(final_coord, start_coord, round_to=2):
|
17 |
return round(np.sqrt((final_coord[0] - start_coord[0])**2 + (final_coord[1] - start_coord[1])**2), round_to)
|
@@ -77,5 +79,5 @@ iters = gr.Number(value=1e5,label="How many random steps?")
|
|
77 |
step_size = gr.Number(value=1,label="Step size")
|
78 |
random_seed = gr.Number(value=42,label="Random seed (Delete it to go full random mode)")
|
79 |
|
80 |
-
iface = gr.Interface(fn=generate_random_walk, inputs=[iters, step_size, random_seed], outputs=["image","file"], title="2-D Random Walk
|
81 |
iface.launch()
|
|
|
12 |
|
13 |
if random_seed is None:
|
14 |
random_seed = random.randint(1, 100000)
|
15 |
+
else:
|
16 |
+
random_seed = random_seed
|
17 |
|
18 |
def distance_from_start(final_coord, start_coord, round_to=2):
|
19 |
return round(np.sqrt((final_coord[0] - start_coord[0])**2 + (final_coord[1] - start_coord[1])**2), round_to)
|
|
|
79 |
step_size = gr.Number(value=1,label="Step size")
|
80 |
random_seed = gr.Number(value=42,label="Random seed (Delete it to go full random mode)")
|
81 |
|
82 |
+
iface = gr.Interface(fn=generate_random_walk, inputs=[iters, step_size, random_seed], outputs=["image","file"], title="2-D Random Walk", description="Uniform steps along NEWS directions only")
|
83 |
iface.launch()
|