-
Notifications
You must be signed in to change notification settings - Fork 6
Expand file tree
/
Copy pathrun.sh
More file actions
executable file
Β·45 lines (35 loc) Β· 1.27 KB
/
run.sh
File metadata and controls
executable file
Β·45 lines (35 loc) Β· 1.27 KB
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
32
33
34
35
36
37
38
39
40
41
42
43
44
45
#!/bin/bash
# Active Inference Python Implementation Runner
set -e
echo "π Python Active Inference Demo"
echo "==============================="
# Check if Python is installed
if ! command -v python3 &> /dev/null; then
echo "β Error: Python 3 not found"
echo "Please install Python 3 with: sudo apt-get install python3"
exit 1
fi
echo "β
Python found: $(python3 --version)"
# Install dependencies
echo "π¦ Installing Python dependencies..."
if ! pip3 install -r requirements.txt; then
echo "β οΈ Warning: Could not install packages globally, trying user install..."
pip3 install --user -r requirements.txt || { echo "β Error: Could not install Python dependencies"; exit 1; }
fi
# Run the main implementation
echo "π Running Python active inference simulation..."
python3 student_teacher.py
# Generate visualizations
echo "π Generating visualization plots..."
python3 -c "
from student_teacher import StudentTeacherPOMDP
import matplotlib.pyplot as plt
# Create and visualize matrices
pomdp = StudentTeacherPOMDP(4, 3, 2)
pomdp.plot_matrices()
plt.close('all')
print('Visualization plots generated in output/ directory')
"
echo ""
echo "β
Python simulation completed successfully!"
echo "π Check the output/ directory for generated visualizations!"