RL-Accounting 会计强化学习
Redefining Accounting!
Developed by Bfsu Ai-Accounting Team (c) 2023
Github

Install & Import 安装和导入
For detailed installation instructions, see the
documentation.
pip install cpagym
import gymnasium as gym
import cpagym as cg
import torch
Accounting Envs 主要会计环境
1. Moral_Hazard 道德风险
Action Space
Num | Action | Unit |
---|
0 | Discharge of duty | 0 |
1 | Due diligence | 1 |
Observation Space
The observation is a ndarray
with shape (6,)
that provides information about the
two rotational joint angles as well as their angular velocities:
Num | Observation | Min | Max |
---|
0 | Project success rate | 0 | 1 |
1 | Project success return | 0 | 1 |
env = gym.make("Moral_Hazard-v1")
state, info = env.reset(seed=2)
n_steps = 10
for _ in range(n_steps):
action = env.action_space.sample()
state, reward, terminated, truncated, info = env.step(action)
print(observation, reward, terminated, truncated, info )
if terminated or truncated:
observation, info = env.reset()
Accounting RL-Algorithm 会计强化学习算法
1. Train the Agent with DQN
Accounting RL-Agent 会计强化学习代理人
agent=cg.Agent(state_size=1,action_size=2)
env = gym.make("Moral_Hazard-v1")
state, info = env.reset(seed=2)
action = agent.act(state, eps)
next_state, reward, done, _,_ = env.step(action)
agent.step(state, action, reward, next_state, done)
print(agent.memory.memory)
配套智能会计包CPANLP
Check out: https://cpanlp.com/reinforcement