-
Notifications
You must be signed in to change notification settings - Fork 11
/
__init__.py
48 lines (41 loc) · 1.23 KB
/
__init__.py
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
46
47
48
# Copyright (c) 2023, Haruka Kiyohara, Ren Kishimoto, HAKUHODO Technologies Inc., and Hanjuku-kaso Co., Ltd. All rights reserved.
# Licensed under the Apache 2.0 License.
import gym
from sklearn.linear_model import LogisticRegression
from rtbgym.envs.rtb import RTBEnv
from rtbgym.envs.wrapper_rtb import CustomizedRTBEnv
from rtbgym.envs.simulator.function import (
BaseWinningPriceDistribution,
BaseClickAndConversionRate,
)
from .version import __version__ # noqa
__all__ = [
"RTBEnv",
"CustomizedRTBEnv",
"BaseWinningPriceDistribution",
"BaseClickAndConversionRate",
]
# register standard environment
env = RTBEnv(random_state=12345)
# discrete environment
gym.envs.register(
id="RTBEnv-discrete-v0",
entry_point="rtbgym.envs.wrapper_rtb:CustomizedRTBEnv",
nondeterministic=True,
kwargs={
"original_env": env,
"reward_predictor": LogisticRegression(),
"action_type": "discrete",
},
)
# continuous environment
gym.envs.register(
id="RTBEnv-continuous-v0",
entry_point="rtbgym.envs.wrapper_rtb:CustomizedRTBEnv",
nondeterministic=True,
kwargs={
"original_env": env,
"reward_predictor": LogisticRegression(),
"action_type": "continuous",
},
)