File size: 723 Bytes
1b64cdd
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
from environment import DocumentClassificationEnv
import time

env = DocumentClassificationEnv(task_difficulty='hard')
obs, _ = env.reset()

print("Testing Hard Step...")
# Step quickly
obs, reward, done, _, info = env.step(0)
print(f"Reward: {reward:.4f}")
print(f"Is Correct: {info.get('is_correct')}")
print(f"Speed Bonus: {info.get('speed_bonus'):.4f}")
print(f"Proc Cost: {info.get('proc_cost'):.4f}")
print(f"True Category: {info.get('true_category')}")

# Test state API
telemetry = env.state()
print(f"Internal State Action History Length: {len(telemetry['action_history'])}")
print(f"Internal State Reward History: {telemetry['reward_history']}")
print(f"Total reward from state: {telemetry['total_reward']:.4f}")