Add lecture materials for Model-Free, Control, and Value topics

- Added Lecture4 - ModelFree.pdf (3013 KB)
- Added Lecture5 - Control.pdf (2575 KB)
- Added Lecture6 - Value.pdf (3320 KB)
This commit is contained in:
2026-04-28 20:28:00 +08:00
commit ceddbdd559
52 changed files with 117740 additions and 0 deletions
@@ -0,0 +1,32 @@
"""
Part 2: 运行完整的 notebook cells 1-35
解决中文路径编码问题
"""
import warnings, time, os, sys, json, traceback
warnings.filterwarnings('ignore')
import matplotlib
matplotlib.use('Agg')
import matplotlib.pyplot as _p
_p.show = lambda *a, **kw: None
nb = r'D:\Code\doing_exercises\programs\外教作业外快\强化学习个人课程作业报告\notebooks\insurance_premium_risk.ipynb'
cells = json.load(open(nb, encoding='utf-8'))['cells']
code_cells = [c for c in cells if c['cell_type'] == 'code']
print(f"Total code cells: {len(code_cells)}")
main_ns = globals().copy()
main_ns['RANDOM_STATE'] = 42
for i, cell in enumerate(code_cells, start=1):
src = ''.join(cell['source'])
print(f"\n{'='*60}")
print(f"Running cell {i}/{len(code_cells)}...")
try:
exec(compile(src, f'cell_{i}', 'exec'), main_ns)
except Exception as e:
print(f"ERROR cell {i}: {e}")
traceback.print_exc()
print("Stopping.")
break
print("\n\nAll cells executed!")