PowerMachine commited on
Commit
c5a3c96
·
verified ·
1 Parent(s): d908f1e

V6.5-V2-dynamic: upload batch (scripts + state + model) [13 files]

Browse files
kohonen_learning_system.py CHANGED
@@ -581,6 +581,16 @@ class KohonenLearningSystem:
581
 
582
  self.buffer_4d = []
583
  self.buffer_labels = []
 
 
 
 
 
 
 
 
 
 
584
  self.training_ready = False
585
  self.N = N_start
586
  self.dim_choice = dim_choice
@@ -980,23 +990,36 @@ class KohonenLearningSystem:
980
  if dataset_name is not None:
981
  self.last_dataset_used = dataset_name
982
 
983
- for sent, lab in zip(sentences, labels):
984
- self.time_counter += 1
985
- vec = text_to_4d_vector(
986
- sent,
987
- self.tokenizer,
988
- self.embedding,
989
- self.hidden_dim,
990
- self.seq_len,
991
- self.time_counter,
992
- self.T_max,
993
- attention=self.attention, # V6.5-attn
994
- attention_metrics=self.attention_metrics, # V6.5-attn
995
- )
996
- self.buffer_4d.append(vec)
997
- self.buffer_labels.append(lab)
998
- dim_val = round(vec[self.dim_index].item(), 2)
999
- self.histogram[dim_val] += 1
 
 
 
 
 
 
 
 
 
 
 
 
 
1000
 
1001
  def check_training_start(self) -> bool:
1002
  """Inicia treino quando algum bucket do histograma atinge N."""
@@ -1009,20 +1032,27 @@ class KohonenLearningSystem:
1009
  return False
1010
 
1011
  def train_som_on_buffer(self):
1012
- """Treina SOM por 5 épocas sobre o buffer atual (com Fisher accum)."""
 
 
 
 
 
1013
  if not self.buffer_4d:
1014
  return
1015
- data = torch.stack(self.buffer_4d)
1016
- for _ in range(5): # épocas de treino rápido
1017
- perm = torch.randperm(len(data))
1018
- for idx in perm:
1019
- x = data[idx]
1020
- bmu = self.som.find_bmu(x)
1021
- acc_fisher = (
1022
- self.punishment_count == 0
1023
- and self.som.old_weights_w is None
1024
- )
1025
- self.som.update_weights(x, bmu, accumulate_fisher=acc_fisher)
 
 
1026
 
1027
  # V6.5 — Ativa VQ-VAE-2 compressor no pipeline
1028
  if self.enable_vqvae2 and self.vqvae2_compressor is not None:
@@ -1350,30 +1380,38 @@ class KohonenLearningSystem:
1350
  return dist.flatten()
1351
 
1352
  def _label_neurons(self):
1353
- """Rotula neurônios por votação majoritária sobre o buffer."""
 
 
 
1354
  self.neuron_label = {}
1355
  if not self.buffer_4d:
1356
  return
1357
- data = torch.stack(self.buffer_4d)
1358
  labels = torch.tensor(self.buffer_labels)
1359
  votes = defaultdict(lambda: [0, 0])
1360
- for i in range(len(data)):
1361
- bmu = self.som.find_bmu(data[i])
1362
- votes[bmu][int(labels[i].item())] += 1
 
1363
  for bmu, v in votes.items():
1364
  self.neuron_label[bmu] = 1.0 if v[1] > v[0] else 0.0
1365
 
1366
  def evaluate_classification(self) -> float:
1367
- """Acurácia sobre o buffer atual."""
 
 
 
1368
  if not self.buffer_4d:
1369
  return 1.0
1370
- data = torch.stack(self.buffer_4d)
1371
  labels = torch.tensor(self.buffer_labels).float()
1372
  correct = 0
1373
- for i in range(len(data)):
1374
- pred = self._predict_single(data[i])
1375
- if (pred > 0.5) == (labels[i] > 0.5):
1376
- correct += 1
 
1377
  return correct / len(data)
1378
 
1379
  def _predict_single(self, x):
@@ -1624,22 +1662,29 @@ class KohonenLearningSystem:
1624
  self.last_dataset_used = dataset_name
1625
 
1626
  # 2. Compute vec_4d for the misclassified sentence
1627
- self.time_counter += 1
1628
- vec = text_to_4d_vector(
1629
- sentence,
1630
- self.tokenizer,
1631
- self.embedding,
1632
- self.hidden_dim,
1633
- self.seq_len,
1634
- self.time_counter,
1635
- self.T_max,
1636
- attention=self.attention,
1637
- attention_metrics=self.attention_metrics,
1638
- )
 
 
 
1639
 
1640
  # 3. Add to buffer + update histogram (mirror add_data)
1641
  self.buffer_4d.append(vec)
1642
  self.buffer_labels.append(int(correct_label_int))
 
 
 
 
1643
  dim_val = round(vec[self.dim_index].item(), 2)
1644
  self.histogram[dim_val] += 1
1645
 
 
581
 
582
  self.buffer_4d = []
583
  self.buffer_labels = []
584
+ # V6.5-V2-memfix — Sliding window limit for buffer_4d to prevent OOM.
585
+ # User requirement: "resolver falhas de lógica e de bugs que estejam
586
+ # causando alto consumo de memória sem distorcer a arquitetura Kohonen".
587
+ # The buffer stores vec_4d tensors for SOM training and neuron labeling.
588
+ # Without a limit, streaming 8000+ samples accumulates 8000 tensors,
589
+ # each retaining the embedding computation graph (16M params), causing
590
+ # OOM (3.5GB RSS observed). Sliding window of 512 keeps recent samples
591
+ # for SOM updates while bounding memory. The Kohonen architecture (SOM
592
+ # grid, BMU, Gaussian neighborhood, EWC) is NOT changed.
593
+ self.buffer_max_size = 512
594
  self.training_ready = False
595
  self.N = N_start
596
  self.dim_choice = dim_choice
 
990
  if dataset_name is not None:
991
  self.last_dataset_used = dataset_name
992
 
993
+ # V6.5-V2-memfix — Use torch.no_grad() to avoid building computation
994
+ # graphs during vec_4d computation. The embedding graph (16M params)
995
+ # would otherwise be retained by every tensor in buffer_4d, causing OOM
996
+ # with 8000+ samples. The vec_4d is a 4-float summary (x,y,z,w) that
997
+ # does NOT need gradient — it feeds into SOM (Hebbian, no backprop) and
998
+ # the HypothesisClassifier (which trains its own weights).
999
+ with torch.no_grad():
1000
+ for sent, lab in zip(sentences, labels):
1001
+ self.time_counter += 1
1002
+ vec = text_to_4d_vector(
1003
+ sent,
1004
+ self.tokenizer,
1005
+ self.embedding,
1006
+ self.hidden_dim,
1007
+ self.seq_len,
1008
+ self.time_counter,
1009
+ self.T_max,
1010
+ attention=self.attention, # V6.5-attn
1011
+ attention_metrics=self.attention_metrics, # V6.5-attn
1012
+ )
1013
+ # CRITICAL: detach to break any residual graph + clone for safety
1014
+ self.buffer_4d.append(vec.detach().clone())
1015
+ self.buffer_labels.append(lab)
1016
+ dim_val = round(vec[self.dim_index].item(), 2)
1017
+ self.histogram[dim_val] += 1
1018
+ # V6.5-V2-memfix — Enforce sliding window limit
1019
+ if len(self.buffer_4d) > self.buffer_max_size:
1020
+ overflow = len(self.buffer_4d) - self.buffer_max_size
1021
+ self.buffer_4d = self.buffer_4d[-self.buffer_max_size:]
1022
+ self.buffer_labels = self.buffer_labels[-self.buffer_max_size:]
1023
 
1024
  def check_training_start(self) -> bool:
1025
  """Inicia treino quando algum bucket do histograma atinge N."""
 
1032
  return False
1033
 
1034
  def train_som_on_buffer(self):
1035
+ """Treina SOM por 5 épocas sobre o buffer atual (com Fisher accum).
1036
+
1037
+ V6.5-V2-memfix — Wrapped in torch.no_grad() to prevent graph building
1038
+ during SOM Hebbian updates. The SOM uses competitive learning (BMU +
1039
+ Gaussian neighborhood), not backprop — no gradient is needed.
1040
+ """
1041
  if not self.buffer_4d:
1042
  return
1043
+ # V6.5-V2-memfix — detach+stack to ensure no graph leaks from buffer
1044
+ data = torch.stack(self.buffer_4d).detach()
1045
+ with torch.no_grad():
1046
+ for _ in range(5): # épocas de treino rápido
1047
+ perm = torch.randperm(len(data))
1048
+ for idx in perm:
1049
+ x = data[idx]
1050
+ bmu = self.som.find_bmu(x)
1051
+ acc_fisher = (
1052
+ self.punishment_count == 0
1053
+ and self.som.old_weights_w is None
1054
+ )
1055
+ self.som.update_weights(x, bmu, accumulate_fisher=acc_fisher)
1056
 
1057
  # V6.5 — Ativa VQ-VAE-2 compressor no pipeline
1058
  if self.enable_vqvae2 and self.vqvae2_compressor is not None:
 
1380
  return dist.flatten()
1381
 
1382
  def _label_neurons(self):
1383
+ """Rotula neurônios por votação majoritária sobre o buffer.
1384
+
1385
+ V6.5-V2-memfix — no_grad to prevent graph building during BMU search.
1386
+ """
1387
  self.neuron_label = {}
1388
  if not self.buffer_4d:
1389
  return
1390
+ data = torch.stack(self.buffer_4d).detach()
1391
  labels = torch.tensor(self.buffer_labels)
1392
  votes = defaultdict(lambda: [0, 0])
1393
+ with torch.no_grad():
1394
+ for i in range(len(data)):
1395
+ bmu = self.som.find_bmu(data[i])
1396
+ votes[bmu][int(labels[i].item())] += 1
1397
  for bmu, v in votes.items():
1398
  self.neuron_label[bmu] = 1.0 if v[1] > v[0] else 0.0
1399
 
1400
  def evaluate_classification(self) -> float:
1401
+ """Acurácia sobre o buffer atual.
1402
+
1403
+ V6.5-V2-memfix — no_grad to prevent graph building during evaluation.
1404
+ """
1405
  if not self.buffer_4d:
1406
  return 1.0
1407
+ data = torch.stack(self.buffer_4d).detach()
1408
  labels = torch.tensor(self.buffer_labels).float()
1409
  correct = 0
1410
+ with torch.no_grad():
1411
+ for i in range(len(data)):
1412
+ pred = self._predict_single(data[i])
1413
+ if (pred > 0.5) == (labels[i] > 0.5):
1414
+ correct += 1
1415
  return correct / len(data)
1416
 
1417
  def _predict_single(self, x):
 
1662
  self.last_dataset_used = dataset_name
1663
 
1664
  # 2. Compute vec_4d for the misclassified sentence
1665
+ # V6.5-V2-memfix — no_grad + detach to prevent graph accumulation
1666
+ with torch.no_grad():
1667
+ self.time_counter += 1
1668
+ vec = text_to_4d_vector(
1669
+ sentence,
1670
+ self.tokenizer,
1671
+ self.embedding,
1672
+ self.hidden_dim,
1673
+ self.seq_len,
1674
+ self.time_counter,
1675
+ self.T_max,
1676
+ attention=self.attention,
1677
+ attention_metrics=self.attention_metrics,
1678
+ )
1679
+ vec = vec.detach().clone()
1680
 
1681
  # 3. Add to buffer + update histogram (mirror add_data)
1682
  self.buffer_4d.append(vec)
1683
  self.buffer_labels.append(int(correct_label_int))
1684
+ # Enforce sliding window limit (mirror add_data)
1685
+ if len(self.buffer_4d) > self.buffer_max_size:
1686
+ self.buffer_4d = self.buffer_4d[-self.buffer_max_size:]
1687
+ self.buffer_labels = self.buffer_labels[-self.buffer_max_size:]
1688
  dim_val = round(vec[self.dim_index].item(), 2)
1689
  self.histogram[dim_val] += 1
1690
 
v6_5_v2_attention_eval.json CHANGED
@@ -3,18 +3,18 @@
3
  "user_requirement": "verificar se o mecanismo de atenção está ativo e acessado logicamente funcional",
4
  "metrics": {
5
  "active": true,
6
- "n_calls": 3441,
7
  "n_errors": 0,
8
- "last_norm_in": 54.769012451171875,
9
- "last_norm_out": 56.71458053588867,
10
  "last_attn_activated": true,
11
- "last_attn_diff_norm": 56.80364227294922,
12
  "n_heads": 8,
13
  "logic_functional": true
14
  },
15
  "active": true,
16
  "logic_functional": true,
17
- "n_calls": 3441,
18
  "n_errors": 0,
19
  "n_heads": 8,
20
  "assessment": "PASS"
 
3
  "user_requirement": "verificar se o mecanismo de atenção está ativo e acessado logicamente funcional",
4
  "metrics": {
5
  "active": true,
6
+ "n_calls": 10680,
7
  "n_errors": 0,
8
+ "last_norm_in": 111.9294204711914,
9
+ "last_norm_out": 116.00782012939453,
10
  "last_attn_activated": true,
11
+ "last_attn_diff_norm": 116.50959014892578,
12
  "n_heads": 8,
13
  "logic_functional": true
14
  },
15
  "active": true,
16
  "logic_functional": true,
17
+ "n_calls": 10680,
18
  "n_errors": 0,
19
  "n_heads": 8,
20
  "assessment": "PASS"
v6_5_v2_model_states.pt ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:ff42c43886461f7b5cfd55a0d125ce6dbf4f719a0d41383d3991fe687e60958e
3
+ size 220174132
v6_5_v2_model_states_after_conhecimento.pt ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:5e59c64fa9ed050f79bddf2f3546b104a93b846e7af732bd4527c9ed10c578da
3
+ size 217694233
v6_5_v2_phases_eval.json CHANGED
The diff for this file is too large to render. See raw diff
 
v6_5_v2_predict_fix_eval.json CHANGED
@@ -5,8 +5,8 @@
5
  "results": [
6
  {
7
  "query": "o gato dorme na cama",
8
- "prediction": "unpunctuated",
9
- "probability": 0.0,
10
  "is_gato_hardcoded": false,
11
  "is_cachorro_hardcoded": false,
12
  "is_registry_label": true,
@@ -14,8 +14,8 @@
14
  },
15
  {
16
  "query": "calcule dois mais dois",
17
- "prediction": "unpunctuated",
18
- "probability": 0.0,
19
  "is_gato_hardcoded": false,
20
  "is_cachorro_hardcoded": false,
21
  "is_registry_label": true,
@@ -23,8 +23,8 @@
23
  },
24
  {
25
  "query": "qual é a capital do brasil",
26
- "prediction": "unpunctuated",
27
- "probability": 0.0,
28
  "is_gato_hardcoded": false,
29
  "is_cachorro_hardcoded": false,
30
  "is_registry_label": true,
@@ -32,8 +32,8 @@
32
  },
33
  {
34
  "query": "explique o que é uma rede neural",
35
- "prediction": "unpunctuated",
36
- "probability": 0.0,
37
  "is_gato_hardcoded": false,
38
  "is_cachorro_hardcoded": false,
39
  "is_registry_label": true,
@@ -41,8 +41,8 @@
41
  },
42
  {
43
  "query": "olá como você está",
44
- "prediction": "unpunctuated",
45
- "probability": 0.0,
46
  "is_gato_hardcoded": false,
47
  "is_cachorro_hardcoded": false,
48
  "is_registry_label": true,
@@ -50,8 +50,8 @@
50
  },
51
  {
52
  "query": "traduza hello para portugues",
53
- "prediction": "unpunctuated",
54
- "probability": 0.0,
55
  "is_gato_hardcoded": false,
56
  "is_cachorro_hardcoded": false,
57
  "is_registry_label": true,
@@ -103,6 +103,33 @@
103
  ],
104
  "prediction": "unpunctuated",
105
  "valid_for_dataset": true
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
106
  }
107
  ],
108
  "summary": {
 
5
  "results": [
6
  {
7
  "query": "o gato dorme na cama",
8
+ "prediction": "short_text",
9
+ "probability": NaN,
10
  "is_gato_hardcoded": false,
11
  "is_cachorro_hardcoded": false,
12
  "is_registry_label": true,
 
14
  },
15
  {
16
  "query": "calcule dois mais dois",
17
+ "prediction": "short_text",
18
+ "probability": NaN,
19
  "is_gato_hardcoded": false,
20
  "is_cachorro_hardcoded": false,
21
  "is_registry_label": true,
 
23
  },
24
  {
25
  "query": "qual é a capital do brasil",
26
+ "prediction": "short_text",
27
+ "probability": NaN,
28
  "is_gato_hardcoded": false,
29
  "is_cachorro_hardcoded": false,
30
  "is_registry_label": true,
 
32
  },
33
  {
34
  "query": "explique o que é uma rede neural",
35
+ "prediction": "short_text",
36
+ "probability": NaN,
37
  "is_gato_hardcoded": false,
38
  "is_cachorro_hardcoded": false,
39
  "is_registry_label": true,
 
41
  },
42
  {
43
  "query": "olá como você está",
44
+ "prediction": "short_text",
45
+ "probability": NaN,
46
  "is_gato_hardcoded": false,
47
  "is_cachorro_hardcoded": false,
48
  "is_registry_label": true,
 
50
  },
51
  {
52
  "query": "traduza hello para portugues",
53
+ "prediction": "short_text",
54
+ "probability": NaN,
55
  "is_gato_hardcoded": false,
56
  "is_cachorro_hardcoded": false,
57
  "is_registry_label": true,
 
103
  ],
104
  "prediction": "unpunctuated",
105
  "valid_for_dataset": true
106
+ },
107
+ {
108
+ "dataset": "iara-project/news-articles-ptbr-dataset",
109
+ "expected_labels": [
110
+ "headline",
111
+ "body"
112
+ ],
113
+ "prediction": "headline",
114
+ "valid_for_dataset": true
115
+ },
116
+ {
117
+ "dataset": "manoela/noticias_ptbr",
118
+ "expected_labels": [
119
+ "headline",
120
+ "body"
121
+ ],
122
+ "prediction": "headline",
123
+ "valid_for_dataset": true
124
+ },
125
+ {
126
+ "dataset": "BrunoN-Dev/corpus-ptbr-v1",
127
+ "expected_labels": [
128
+ "short_text",
129
+ "long_text"
130
+ ],
131
+ "prediction": "short_text",
132
+ "valid_for_dataset": true
133
  }
134
  ],
135
  "summary": {
v6_5_v2_report.json CHANGED
@@ -1,6 +1,6 @@
1
  {
2
  "version": "V6.5-V2",
3
- "timestamp": "2026-08-08T21:26:39.965059",
4
  "config": {
5
  "som_grid": [
6
  6,
@@ -9,14 +9,14 @@
9
  4
10
  ],
11
  "n_neurons": 864,
12
- "hidden_dim": 256,
13
- "vocab_size": 4096,
14
- "n_hypotheses": 8,
15
  "n_trials": 3,
16
- "hyp_train_steps": 20,
17
  "stream_batch_size": 100,
18
- "meta_conhecimento": 6000,
19
- "meta_punicão": 1000,
20
  "conhecimento_datasets": [
21
  "dominguesm/restore-punctuation-ptbr-dataset",
22
  "carolina-c4ai/corpus-carolina",
@@ -54,10 +54,10 @@
54
  "init_done": true
55
  },
56
  "fp16_benchmark": {
57
- "best_time_ms": 94.09655899980862,
58
- "avg_time_ms": 97.57540749978943,
59
- "best_tflops": 1.3603047907443706,
60
- "avg_tflops": 1.3118059486482412,
61
  "matrix_size": 4000.0
62
  },
63
  "v2_verification": {
@@ -84,24 +84,24 @@
84
  "all_pass": true
85
  },
86
  "fase_1_conhecimento_summary": {
87
- "total_samples": 3300,
88
- "meta_atingida": false,
89
- "elapsed_s": 425.32095551490784,
90
- "storage_critical_stopped": true
91
  },
92
  "fase_2_punicão_summary": {
93
- "total_samples": 0,
94
- "meta_atingida": false,
95
- "elapsed_s": 0.0,
96
- "punishment_events": 0,
97
- "hypotheses_trainings": 0,
98
- "delta_applications": 0,
99
- "skipped": true
100
  },
101
  "attention_eval_summary": {
102
  "active": true,
103
  "logic_functional": true,
104
- "n_calls": 3441,
105
  "assessment": "PASS"
106
  },
107
  "predict_fix_summary": {
@@ -117,56 +117,178 @@
117
  "n_with_think": 3,
118
  "answer_rate": 1.0,
119
  "think_rate": 1.0,
120
- "avg_latency_ms": 3.060022989908854,
121
- "avg_reasoning_length": 1030.0
122
  },
123
  "model_states_saved_to": "/home/z/my-project/BiGRU_T_version/v6_5_v2_model_states.pt",
124
  "save_info": {
125
  "saved": true,
126
  "path": "/home/z/my-project/BiGRU_T_version/v6_5_v2_model_states.pt",
127
- "size_mb": 40.959502,
128
  "reason": "end_of_training_v2",
129
- "step": 225,
130
- "total_samples": 3300,
131
  "n_tensors": 7,
132
  "n_buffer_tail": 128
133
  },
134
  "final_v2_metrics": {
135
  "version": "V2-dynamic",
136
- "n_hypotheses": 8,
137
- "n_hypotheses_active": 8,
138
- "max_n_hypotheses": 16,
139
- "n_trials": 3,
140
- "hyp_train_steps": 20,
141
  "hyp_lr": 0.0001,
142
- "delta_scale": 0.009999999776482582,
143
- "n_generators": 16,
144
  "punishment_count": 0,
145
  "success_count": 0,
146
- "training_ready": true,
147
- "classifier_trained": false,
148
- "ewc_reference_set": false,
149
  "buffer_size": 256,
150
  "dynamic_adaptation": {
151
- "loss_history_len": 0,
152
  "loss_stats": {
153
- "slope": 0.0,
154
- "volatility": 0.0,
155
- "mean": 0.0,
156
- "n": 0
 
157
  },
158
- "punishment_rate": 0.0,
159
- "punishment_window_size": 0,
160
- "n_adaptations": 0,
161
  "limits": {
162
  "min_n_hypotheses": 4,
163
- "max_n_hypotheses": 16,
164
  "min_n_trials": 1,
165
  "max_n_trials": 6,
166
- "min_hyp_train_steps": 5,
167
- "max_hyp_train_steps": 60
168
  },
169
- "last_5_adaptations": []
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
170
  }
171
  }
172
  }
 
1
  {
2
  "version": "V6.5-V2",
3
+ "timestamp": "2026-08-08T23:52:08.862775",
4
  "config": {
5
  "som_grid": [
6
  6,
 
9
  4
10
  ],
11
  "n_neurons": 864,
12
+ "hidden_dim": 1024,
13
+ "vocab_size": 16384,
14
+ "n_hypotheses": 16,
15
  "n_trials": 3,
16
+ "hyp_train_steps": 30,
17
  "stream_batch_size": 100,
18
+ "meta_conhecimento": 8000,
19
+ "meta_punicão": 2000,
20
  "conhecimento_datasets": [
21
  "dominguesm/restore-punctuation-ptbr-dataset",
22
  "carolina-c4ai/corpus-carolina",
 
54
  "init_done": true
55
  },
56
  "fp16_benchmark": {
57
+ "best_time_ms": 91.0796530006337,
58
+ "avg_time_ms": 91.46852800040506,
59
+ "best_tflops": 1.4053632812930177,
60
+ "avg_tflops": 1.3993884322641899,
61
  "matrix_size": 4000.0
62
  },
63
  "v2_verification": {
 
84
  "all_pass": true
85
  },
86
  "fase_1_conhecimento_summary": {
87
+ "total_samples": 8000,
88
+ "meta_atingida": true,
89
+ "elapsed_s": 722.1084952354431,
90
+ "storage_critical_stopped": false
91
  },
92
  "fase_2_punicão_summary": {
93
+ "total_samples": 2000,
94
+ "meta_atingida": true,
95
+ "elapsed_s": 507.18996810913086,
96
+ "punishment_events": 120,
97
+ "hypotheses_trainings": 60,
98
+ "delta_applications": 60,
99
+ "skipped": false
100
  },
101
  "attention_eval_summary": {
102
  "active": true,
103
  "logic_functional": true,
104
+ "n_calls": 10680,
105
  "assessment": "PASS"
106
  },
107
  "predict_fix_summary": {
 
117
  "n_with_think": 3,
118
  "answer_rate": 1.0,
119
  "think_rate": 1.0,
120
+ "avg_latency_ms": 11.263132095336914,
121
+ "avg_reasoning_length": 1026.0
122
  },
123
  "model_states_saved_to": "/home/z/my-project/BiGRU_T_version/v6_5_v2_model_states.pt",
124
  "save_info": {
125
  "saved": true,
126
  "path": "/home/z/my-project/BiGRU_T_version/v6_5_v2_model_states.pt",
127
+ "size_mb": 220.174132,
128
  "reason": "end_of_training_v2",
129
+ "step": 700,
130
+ "total_samples": 10000,
131
  "n_tensors": 7,
132
  "n_buffer_tail": 128
133
  },
134
  "final_v2_metrics": {
135
  "version": "V2-dynamic",
136
+ "n_hypotheses": 16,
137
+ "n_hypotheses_active": 16,
138
+ "max_n_hypotheses": 32,
139
+ "n_trials": 6,
140
+ "hyp_train_steps": 30,
141
  "hyp_lr": 0.0001,
142
+ "delta_scale": 0.0010000000474974513,
143
+ "n_generators": 32,
144
  "punishment_count": 0,
145
  "success_count": 0,
146
+ "training_ready": false,
147
+ "classifier_trained": true,
148
+ "ewc_reference_set": true,
149
  "buffer_size": 256,
150
  "dynamic_adaptation": {
151
+ "loss_history_len": 8,
152
  "loss_stats": {
153
+ "slope": NaN,
154
+ "volatility": NaN,
155
+ "mean": NaN,
156
+ "std": NaN,
157
+ "n": 8
158
  },
159
+ "punishment_rate": 1.0,
160
+ "punishment_window_size": 12,
161
+ "n_adaptations": 20,
162
  "limits": {
163
  "min_n_hypotheses": 4,
164
+ "max_n_hypotheses": 32,
165
  "min_n_trials": 1,
166
  "max_n_trials": 6,
167
+ "min_hyp_train_steps": 10,
168
+ "max_hyp_train_steps": 80
169
  },
170
+ "last_5_adaptations": [
171
+ {
172
+ "trigger": "punishment",
173
+ "step": 115,
174
+ "before": {
175
+ "n_hypotheses": 16,
176
+ "n_trials": 6,
177
+ "hyp_train_steps": 30
178
+ },
179
+ "after": {
180
+ "n_hypotheses": 16,
181
+ "n_trials": 6,
182
+ "hyp_train_steps": 30
183
+ },
184
+ "adapted": false,
185
+ "rules_fired": [],
186
+ "loss_stats": {
187
+ "slope": NaN,
188
+ "volatility": NaN,
189
+ "mean": NaN,
190
+ "std": NaN,
191
+ "n": 8
192
+ },
193
+ "punishment_rate": 1.0
194
+ },
195
+ {
196
+ "trigger": "auto",
197
+ "step": 116,
198
+ "before": {
199
+ "n_hypotheses": 16,
200
+ "n_trials": 6,
201
+ "hyp_train_steps": 30
202
+ },
203
+ "after": {
204
+ "n_hypotheses": 16,
205
+ "n_trials": 6,
206
+ "hyp_train_steps": 30
207
+ },
208
+ "adapted": false,
209
+ "rules_fired": [],
210
+ "loss_stats": {
211
+ "slope": NaN,
212
+ "volatility": NaN,
213
+ "mean": NaN,
214
+ "std": NaN,
215
+ "n": 8
216
+ },
217
+ "punishment_rate": 1.0
218
+ },
219
+ {
220
+ "trigger": "punishment",
221
+ "step": 117,
222
+ "before": {
223
+ "n_hypotheses": 16,
224
+ "n_trials": 6,
225
+ "hyp_train_steps": 30
226
+ },
227
+ "after": {
228
+ "n_hypotheses": 16,
229
+ "n_trials": 6,
230
+ "hyp_train_steps": 30
231
+ },
232
+ "adapted": false,
233
+ "rules_fired": [],
234
+ "loss_stats": {
235
+ "slope": NaN,
236
+ "volatility": NaN,
237
+ "mean": NaN,
238
+ "std": NaN,
239
+ "n": 8
240
+ },
241
+ "punishment_rate": 1.0
242
+ },
243
+ {
244
+ "trigger": "auto",
245
+ "step": 118,
246
+ "before": {
247
+ "n_hypotheses": 16,
248
+ "n_trials": 6,
249
+ "hyp_train_steps": 30
250
+ },
251
+ "after": {
252
+ "n_hypotheses": 16,
253
+ "n_trials": 6,
254
+ "hyp_train_steps": 30
255
+ },
256
+ "adapted": false,
257
+ "rules_fired": [],
258
+ "loss_stats": {
259
+ "slope": NaN,
260
+ "volatility": NaN,
261
+ "mean": NaN,
262
+ "std": NaN,
263
+ "n": 8
264
+ },
265
+ "punishment_rate": 1.0
266
+ },
267
+ {
268
+ "trigger": "punishment",
269
+ "step": 119,
270
+ "before": {
271
+ "n_hypotheses": 16,
272
+ "n_trials": 6,
273
+ "hyp_train_steps": 30
274
+ },
275
+ "after": {
276
+ "n_hypotheses": 16,
277
+ "n_trials": 6,
278
+ "hyp_train_steps": 30
279
+ },
280
+ "adapted": false,
281
+ "rules_fired": [],
282
+ "loss_stats": {
283
+ "slope": NaN,
284
+ "volatility": NaN,
285
+ "mean": NaN,
286
+ "std": NaN,
287
+ "n": 8
288
+ },
289
+ "punishment_rate": 1.0
290
+ }
291
+ ]
292
  }
293
  }
294
  }
v6_5_v2_user_questions.json CHANGED
@@ -18,17 +18,17 @@
18
  "context_provided": false,
19
  "system_prompt_used": false,
20
  "few_shot_examples": false,
21
- "som_prediction": "unpunctuated",
22
- "reasoning_length": 1028,
23
  "has_think": true,
24
  "has_plan": true,
25
  "has_answer": true,
26
  "has_decompose": true,
27
  "think_preview": "Analisando a query: 'Luva de Pedreiro Távila'\nIdentificando o tipo de problema e requisitos.\nDeterminando se ferramentas são necessárias.",
28
- "answer_preview": "prediction=unpunctuated | BMU=(4, 4, 5, 0)",
29
  "raw_response_preview": "<think>\nAnalisando a query: 'Luva de Pedreiro Távila'\nIdentificando o tipo de problema e requisitos.\nDeterminando se ferramentas são necessárias.\n</think>\n<plan>\nPlano de resolução:\n1. Decompor o problema em sub-tarefas\n2. Identificar ferramentas necessárias (disponíveis: som_query, buffer_stats)\n3. Executar sub-tarefas em sequência\n4. Monitorar resultados\n5. Compor resposta final\n</plan>\n<decompose>\n- Processar: Luva de Pedreiro Távila\n</decompose>\n<execute>\nSub-tarefa 'Processar: Luva de Pedre...",
30
  "n_tags": 4,
31
- "latency_ms": 3.1023025512695312
32
  },
33
  {
34
  "query": "Lula reserva valor",
@@ -36,17 +36,17 @@
36
  "context_provided": false,
37
  "system_prompt_used": false,
38
  "few_shot_examples": false,
39
- "som_prediction": "unpunctuated",
40
- "reasoning_length": 998,
41
  "has_think": true,
42
  "has_plan": true,
43
  "has_answer": true,
44
  "has_decompose": true,
45
  "think_preview": "Analisando a query: 'Lula reserva valor'\nIdentificando o tipo de problema e requisitos.\nDeterminando se ferramentas são necessárias.",
46
- "answer_preview": "prediction=unpunctuated | BMU=(4, 4, 5, 0)",
47
  "raw_response_preview": "<think>\nAnalisando a query: 'Lula reserva valor'\nIdentificando o tipo de problema e requisitos.\nDeterminando se ferramentas são necessárias.\n</think>\n<plan>\nPlano de resolução:\n1. Decompor o problema em sub-tarefas\n2. Identificar ferramentas necessárias (disponíveis: som_query, buffer_stats)\n3. Executar sub-tarefas em sequência\n4. Monitorar resultados\n5. Compor resposta final\n</plan>\n<decompose>\n- Processar: Lula reserva valor\n</decompose>\n<execute>\nSub-tarefa 'Processar: Lula reserva valor' exe...",
48
  "n_tags": 4,
49
- "latency_ms": 3.0732154846191406
50
  },
51
  {
52
  "query": "Amazonas força-tarefa vítimas",
@@ -54,17 +54,17 @@
54
  "context_provided": false,
55
  "system_prompt_used": false,
56
  "few_shot_examples": false,
57
- "som_prediction": "unpunctuated",
58
- "reasoning_length": 1064,
59
  "has_think": true,
60
  "has_plan": true,
61
  "has_answer": true,
62
  "has_decompose": true,
63
  "think_preview": "Analisando a query: 'Amazonas força-tarefa vítimas'\nIdentificando o tipo de problema e requisitos.\nDeterminando se ferramentas são necessárias.",
64
- "answer_preview": "prediction=unpunctuated | BMU=(4, 4, 5, 0)",
65
  "raw_response_preview": "<think>\nAnalisando a query: 'Amazonas força-tarefa vítimas'\nIdentificando o tipo de problema e requisitos.\nDeterminando se ferramentas são necessárias.\n</think>\n<plan>\nPlano de resolução:\n1. Decompor o problema em sub-tarefas\n2. Identificar ferramentas necessárias (disponíveis: som_query, buffer_stats)\n3. Executar sub-tarefas em sequência\n4. Monitorar resultados\n5. Compor resposta final\n</plan>\n<decompose>\n- Processar: Amazonas força-tarefa vítimas\n</decompose>\n<execute>\nSub-tarefa 'Processar: A...",
66
  "n_tags": 4,
67
- "latency_ms": 3.0045509338378906
68
  }
69
  ],
70
  "summary": {
@@ -72,8 +72,8 @@
72
  "n_with_think": 3,
73
  "answer_rate": 1.0,
74
  "think_rate": 1.0,
75
- "avg_latency_ms": 3.060022989908854,
76
- "avg_reasoning_length": 1030.0
77
  },
78
  "quality_assessment": {
79
  "model_not_helped": true,
 
18
  "context_provided": false,
19
  "system_prompt_used": false,
20
  "few_shot_examples": false,
21
+ "som_prediction": "short_text",
22
+ "reasoning_length": 1024,
23
  "has_think": true,
24
  "has_plan": true,
25
  "has_answer": true,
26
  "has_decompose": true,
27
  "think_preview": "Analisando a query: 'Luva de Pedreiro Távila'\nIdentificando o tipo de problema e requisitos.\nDeterminando se ferramentas são necessárias.",
28
+ "answer_preview": "prediction=short_text | BMU=(0, 0, 0, 0)",
29
  "raw_response_preview": "<think>\nAnalisando a query: 'Luva de Pedreiro Távila'\nIdentificando o tipo de problema e requisitos.\nDeterminando se ferramentas são necessárias.\n</think>\n<plan>\nPlano de resolução:\n1. Decompor o problema em sub-tarefas\n2. Identificar ferramentas necessárias (disponíveis: som_query, buffer_stats)\n3. Executar sub-tarefas em sequência\n4. Monitorar resultados\n5. Compor resposta final\n</plan>\n<decompose>\n- Processar: Luva de Pedreiro Távila\n</decompose>\n<execute>\nSub-tarefa 'Processar: Luva de Pedre...",
30
  "n_tags": 4,
31
+ "latency_ms": 9.467601776123047
32
  },
33
  {
34
  "query": "Lula reserva valor",
 
36
  "context_provided": false,
37
  "system_prompt_used": false,
38
  "few_shot_examples": false,
39
+ "som_prediction": "short_text",
40
+ "reasoning_length": 994,
41
  "has_think": true,
42
  "has_plan": true,
43
  "has_answer": true,
44
  "has_decompose": true,
45
  "think_preview": "Analisando a query: 'Lula reserva valor'\nIdentificando o tipo de problema e requisitos.\nDeterminando se ferramentas são necessárias.",
46
+ "answer_preview": "prediction=short_text | BMU=(0, 0, 0, 0)",
47
  "raw_response_preview": "<think>\nAnalisando a query: 'Lula reserva valor'\nIdentificando o tipo de problema e requisitos.\nDeterminando se ferramentas são necessárias.\n</think>\n<plan>\nPlano de resolução:\n1. Decompor o problema em sub-tarefas\n2. Identificar ferramentas necessárias (disponíveis: som_query, buffer_stats)\n3. Executar sub-tarefas em sequência\n4. Monitorar resultados\n5. Compor resposta final\n</plan>\n<decompose>\n- Processar: Lula reserva valor\n</decompose>\n<execute>\nSub-tarefa 'Processar: Lula reserva valor' exe...",
48
  "n_tags": 4,
49
+ "latency_ms": 11.906862258911133
50
  },
51
  {
52
  "query": "Amazonas força-tarefa vítimas",
 
54
  "context_provided": false,
55
  "system_prompt_used": false,
56
  "few_shot_examples": false,
57
+ "som_prediction": "short_text",
58
+ "reasoning_length": 1060,
59
  "has_think": true,
60
  "has_plan": true,
61
  "has_answer": true,
62
  "has_decompose": true,
63
  "think_preview": "Analisando a query: 'Amazonas força-tarefa vítimas'\nIdentificando o tipo de problema e requisitos.\nDeterminando se ferramentas são necessárias.",
64
+ "answer_preview": "prediction=short_text | BMU=(0, 0, 0, 0)",
65
  "raw_response_preview": "<think>\nAnalisando a query: 'Amazonas força-tarefa vítimas'\nIdentificando o tipo de problema e requisitos.\nDeterminando se ferramentas são necessárias.\n</think>\n<plan>\nPlano de resolução:\n1. Decompor o problema em sub-tarefas\n2. Identificar ferramentas necessárias (disponíveis: som_query, buffer_stats)\n3. Executar sub-tarefas em sequência\n4. Monitorar resultados\n5. Compor resposta final\n</plan>\n<decompose>\n- Processar: Amazonas força-tarefa vítimas\n</decompose>\n<execute>\nSub-tarefa 'Processar: A...",
66
  "n_tags": 4,
67
+ "latency_ms": 12.414932250976562
68
  }
69
  ],
70
  "summary": {
 
72
  "n_with_think": 3,
73
  "answer_rate": 1.0,
74
  "think_rate": 1.0,
75
+ "avg_latency_ms": 11.263132095336914,
76
+ "avg_reasoning_length": 1026.0
77
  },
78
  "quality_assessment": {
79
  "model_not_helped": true,