projects
/
culture.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Update.
[culture.git]
/
reasoning.py
diff --git
a/reasoning.py
b/reasoning.py
index
768c15c
..
2874adc
100755
(executable)
--- a/
reasoning.py
+++ b/
reasoning.py
@@
-27,9
+27,9
@@
class Reasoning(problem.Problem):
("cyan", [0, 255, 255]),
("violet", [255, 0, 255]),
("lightgreen", [192, 255, 192]),
("cyan", [0, 255, 255]),
("violet", [255, 0, 255]),
("lightgreen", [192, 255, 192]),
- ("
pink", [255, 192, 19
2]),
+ ("
brown", [165, 42, 4
2]),
("lightblue", [192, 192, 255]),
("lightblue", [192, 192, 255]),
- ("gray", [1
92, 192, 192
]),
+ ("gray", [1
28, 128, 128
]),
]
def __init__(self, device=torch.device("cpu")):
]
def __init__(self, device=torch.device("cpu")):
@@
-294,7
+294,7
@@
class Reasoning(problem.Problem):
f_X[i1:i2, j1:j2] = c[n if n > 0 else -1]
def task_move(self, A, f_A, B, f_B):
f_X[i1:i2, j1:j2] = c[n if n > 0 else -1]
def task_move(self, A, f_A, B, f_B):
- di, dj = torch.randint(
2, (2,)) * 2
- 1
+ di, dj = torch.randint(
3, (2,))
- 1
nb_rec = 3
c = torch.randperm(len(self.colors) - 1)[:nb_rec] + 1
for X, f_X in [(A, f_A), (B, f_B)]:
nb_rec = 3
c = torch.randperm(len(self.colors) - 1)[:nb_rec] + 1
for X, f_X in [(A, f_A), (B, f_B)]:
@@
-467,8
+467,8
@@
if __name__ == "__main__":
delay = time.perf_counter() - start_time
print(f"{prompts.size(0)/delay:02f} seq/s")
delay = time.perf_counter() - start_time
print(f"{prompts.size(0)/delay:02f} seq/s")
-
#
predicted_prompts = torch.rand(prompts.size(0)) < 0.5
-
#
predicted_answers = torch.logical_not(predicted_prompts)
+ predicted_prompts = torch.rand(prompts.size(0)) < 0.5
+ predicted_answers = torch.logical_not(predicted_prompts)
reasoning.save_quizzes(
"/tmp",
reasoning.save_quizzes(
"/tmp",
@@
-476,5
+476,6
@@
if __name__ == "__main__":
prompts[:64],
answers[:64],
# You can add a bool to put a frame around the predicted parts
prompts[:64],
answers[:64],
# You can add a bool to put a frame around the predicted parts
- # predicted_prompts, predicted_answers
+ predicted_prompts[:64],
+ predicted_answers[:64],
)
)