mirror of
https://github.com/facebookresearch/ReAgent.git
synced 2026-05-17 12:40:39 +00:00
Auto-format
Summary: Apply black formatter Reviewed By: kaiwenw Differential Revision: D24163592 fbshipit-source-id: 4de5c52dd0ec2c5b72a7b4b5362d19005458643c
This commit is contained in:
committed by
Facebook GitHub Bot
parent
38d9a7ef00
commit
cdd8040720
@@ -14,8 +14,8 @@ import torch
|
||||
import torch.nn.functional as F
|
||||
from reagent.gym.types import Trajectory
|
||||
from reagent.parameters import CONTINUOUS_TRAINING_ACTION_RANGE
|
||||
from reagent.training.reagent_lightning_module import ReAgentLightningModule
|
||||
from reagent.preprocessing.types import InputColumn
|
||||
from reagent.training.reagent_lightning_module import ReAgentLightningModule
|
||||
from reagent.training.trainer import Trainer
|
||||
from reagent.training.utils import rescale_actions
|
||||
|
||||
|
||||
@@ -4,7 +4,6 @@ import random
|
||||
import unittest
|
||||
|
||||
import torch
|
||||
|
||||
from reagent.ope.estimators.slate_estimators import (
|
||||
DCGSlateMetric,
|
||||
NDCGSlateMetric,
|
||||
|
||||
@@ -4,7 +4,6 @@ import unittest
|
||||
|
||||
import numpy as np
|
||||
import torch
|
||||
|
||||
from reagent.ope.utils import Clamper, RunningAverage
|
||||
|
||||
|
||||
|
||||
@@ -3,8 +3,8 @@
|
||||
|
||||
import logging
|
||||
|
||||
import torch
|
||||
import numpy.testing as npt
|
||||
import torch
|
||||
|
||||
|
||||
logger = logging.getLogger(__name__)
|
||||
|
||||
@@ -2,8 +2,8 @@
|
||||
# Copyright 2004-present Facebook. All Rights Reserved.
|
||||
|
||||
from collections import OrderedDict
|
||||
from typing import Dict, List, Union
|
||||
from enum import Enum
|
||||
from typing import Dict, List, Union
|
||||
|
||||
|
||||
class ConfigBaseMeta(type):
|
||||
@@ -106,9 +106,9 @@ class Constant(ConfigBase):
|
||||
|
||||
|
||||
class DecisionRewardAggreation(Enum):
|
||||
DRA_INVALID = None,
|
||||
DRA_SUM = 'sum',
|
||||
DRA_MAX = 'max',
|
||||
DRA_INVALID = (None,)
|
||||
DRA_SUM = ("sum",)
|
||||
DRA_MAX = ("max",)
|
||||
|
||||
|
||||
class DecisionConfig(ConfigBase):
|
||||
|
||||
@@ -28,7 +28,7 @@ def export(app_id, config_dir):
|
||||
if not os.path.exists(sub_config_dir):
|
||||
os.makedirs(sub_config_dir)
|
||||
for config_name, config in configs.items():
|
||||
config_file = os.path.join(sub_config_dir, config_name + '.json')
|
||||
config_file = os.path.join(sub_config_dir, config_name + ".json")
|
||||
print(f"{app_id}:{config_name} exported to {config_file}")
|
||||
with open(config_file, "w") as f:
|
||||
json.dump(config, f, indent=2)
|
||||
|
||||
Reference in New Issue
Block a user