AI, better than 60 percent bro PLEASE
This commit is contained in:
@@ -417,8 +417,6 @@ def main():
|
|||||||
|
|
||||||
# Training loop
|
# Training loop
|
||||||
best_acc = 0.0
|
best_acc = 0.0
|
||||||
patience = 15
|
|
||||||
wait = 0
|
|
||||||
epochs = 60
|
epochs = 60
|
||||||
|
|
||||||
print("\n" + "=" * 60)
|
print("\n" + "=" * 60)
|
||||||
@@ -473,7 +471,6 @@ def main():
|
|||||||
# Save best model
|
# Save best model
|
||||||
if test_acc > best_acc:
|
if test_acc > best_acc:
|
||||||
best_acc = test_acc
|
best_acc = test_acc
|
||||||
wait = 0
|
|
||||||
torch.save({
|
torch.save({
|
||||||
'model': model.state_dict(),
|
'model': model.state_dict(),
|
||||||
'optimizer': optimizer.state_dict(),
|
'optimizer': optimizer.state_dict(),
|
||||||
@@ -488,13 +485,8 @@ def main():
|
|||||||
}, "best_asl_transformer.pth")
|
}, "best_asl_transformer.pth")
|
||||||
print(f" → New best: {best_acc:.2f}% ✓")
|
print(f" → New best: {best_acc:.2f}% ✓")
|
||||||
else:
|
else:
|
||||||
wait += 1
|
|
||||||
print()
|
print()
|
||||||
|
|
||||||
if wait >= patience:
|
|
||||||
print(f"\nEarly stopping triggered at epoch {epoch + 1}")
|
|
||||||
break
|
|
||||||
|
|
||||||
print("\n" + "=" * 60)
|
print("\n" + "=" * 60)
|
||||||
print(f"✓ Training complete!")
|
print(f"✓ Training complete!")
|
||||||
print(f"✓ Best test accuracy: {best_acc:.2f}%")
|
print(f"✓ Best test accuracy: {best_acc:.2f}%")
|
||||||
|
|||||||
Reference in New Issue
Block a user