projects
/
picoclvr.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Update.
[picoclvr.git]
/
expr.py
diff --git
a/expr.py
b/expr.py
index
818360b
..
e539fcb
100755
(executable)
--- a/
expr.py
+++ b/
expr.py
@@
-24,7
+24,7
@@
def random_expr(variables, budget):
else:
return str(torch.randint(10, (1,)).item())
else:
else:
return str(torch.randint(10, (1,)).item())
else:
- op = torch.randint(
4
, (1,)).item()
+ op = torch.randint(
3
, (1,)).item()
if op == 0:
e = random_expr(variables, budget - 2)
if ("+" in e or "-" in e or "*" in e) and (e[0] != "(" or e[-1] != ")"):
if op == 0:
e = random_expr(variables, budget - 2)
if ("+" in e or "-" in e or "*" in e) and (e[0] != "(" or e[-1] != ")"):
@@
-38,8
+38,6
@@
def random_expr(variables, budget):
if op == 1:
return e1 + "+" + e2
elif op == 2:
if op == 1:
return e1 + "+" + e2
elif op == 2:
- return e1 + "+" + e2
- elif op == 3:
return e1 + "*" + e2
return e1 + "*" + e2