-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathtest_ae.py
More file actions
31 lines (25 loc) · 823 Bytes
/
test_ae.py
File metadata and controls
31 lines (25 loc) · 823 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
#!/usr/bin/env python3
"""
Simple test script for the autoencoder implementation
"""
try:
import torch
import torch.nn as nn
import torch.nn.functional as F
import pytorch_lightning as L
from torch import optim
import numpy as np
print("✓ All imports successful")
# Import our autoencoder
from networks.model.ae import AutoencoderLightning, test_autoencoder
print("✓ Autoencoder import successful")
# Test the autoencoder
test_autoencoder()
print("✓ Autoencoder test completed successfully!")
except ImportError as e:
print(f"✗ Import error: {e}")
print("Please ensure PyTorch and PyTorch Lightning are installed")
except Exception as e:
print(f"✗ Error during testing: {e}")
import traceback
traceback.print_exc()