Skip to content

Commit

Permalink
Pyre Configurationless migration for] [batch:90/244]
Browse files Browse the repository at this point in the history
Reviewed By: connernilsen

Differential Revision: D54472020

fbshipit-source-id: 0c4ba47ab15a5ef47d5a32aa9afcd90b3cf69491
  • Loading branch information
generatedunixname89002005287564 authored and facebook-github-bot committed Mar 4, 2024
1 parent 0f836df commit 20da07c
Show file tree
Hide file tree
Showing 170 changed files with 336 additions and 0 deletions.
2 changes: 2 additions & 0 deletions pearl/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,8 @@
# This source code is licensed under the MIT license found in the
# LICENSE file in the root directory of this source tree.

# pyre-strict

from .pearl_agent import PearlAgent

__all__ = ["PearlAgent"]
2 changes: 2 additions & 0 deletions pearl/action_representation_modules/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,8 @@
# This source code is licensed under the MIT license found in the
# LICENSE file in the root directory of this source tree.

# pyre-strict

from .action_representation_module import ActionRepresentationModule
from .binary_action_representation_module import BinaryActionTensorRepresentationModule
from .identity_action_representation_module import IdentityActionRepresentationModule
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,8 @@
# LICENSE file in the root directory of this source tree.
#

# pyre-strict

from abc import ABC, abstractmethod

import torch
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,8 @@
# LICENSE file in the root directory of this source tree.
#

# pyre-strict

import torch

from pearl.action_representation_modules.action_representation_module import (
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,8 @@
# LICENSE file in the root directory of this source tree.
#

# pyre-strict

import torch
from pearl.action_representation_modules.action_representation_module import (
ActionRepresentationModule,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,8 @@
# LICENSE file in the root directory of this source tree.
#

# pyre-strict

import torch
import torch.nn.functional as F

Expand Down
2 changes: 2 additions & 0 deletions pearl/api/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,8 @@
# This source code is licensed under the MIT license found in the
# LICENSE file in the root directory of this source tree.

# pyre-strict

from .action import Action
from .action_result import ActionResult
from .action_space import ActionSpace
Expand Down
2 changes: 2 additions & 0 deletions pearl/api/action.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,8 @@
# LICENSE file in the root directory of this source tree.
#

# pyre-strict

from torch import Tensor

# An `Action` is expected to be a 1-dim Tensor of shape `(d,)`, where `d` is the
Expand Down
2 changes: 2 additions & 0 deletions pearl/api/action_result.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,8 @@
# LICENSE file in the root directory of this source tree.
#

# pyre-strict

from dataclasses import dataclass
from typing import Any, Dict, Optional

Expand Down
2 changes: 2 additions & 0 deletions pearl/api/action_space.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,8 @@
# LICENSE file in the root directory of this source tree.
#

# pyre-strict

from __future__ import annotations

from abc import abstractmethod
Expand Down
2 changes: 2 additions & 0 deletions pearl/api/agent.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,8 @@
# LICENSE file in the root directory of this source tree.
#

# pyre-strict

from abc import ABC, abstractmethod

from pearl.api.action import Action
Expand Down
2 changes: 2 additions & 0 deletions pearl/api/environment.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,8 @@
# LICENSE file in the root directory of this source tree.
#

# pyre-strict

from __future__ import annotations

from abc import ABC, abstractmethod
Expand Down
2 changes: 2 additions & 0 deletions pearl/api/history.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,4 +5,6 @@
# LICENSE file in the root directory of this source tree.
#

# pyre-strict

History = object
2 changes: 2 additions & 0 deletions pearl/api/observation.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,4 +5,6 @@
# LICENSE file in the root directory of this source tree.
#

# pyre-strict

Observation = object
2 changes: 2 additions & 0 deletions pearl/api/reward.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,5 +5,7 @@
# LICENSE file in the root directory of this source tree.
#

# pyre-strict

Value = object
Reward = Value
2 changes: 2 additions & 0 deletions pearl/api/space.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,8 @@
# LICENSE file in the root directory of this source tree.
#

# pyre-strict

from __future__ import annotations

from abc import ABC, abstractmethod
Expand Down
2 changes: 2 additions & 0 deletions pearl/api/state.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,8 @@
# LICENSE file in the root directory of this source tree.
#

# pyre-strict

from torch import Tensor

SubjectiveState = Tensor
2 changes: 2 additions & 0 deletions pearl/history_summarization_modules/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,8 @@
# This source code is licensed under the MIT license found in the
# LICENSE file in the root directory of this source tree.

# pyre-strict

from .history_summarization_module import HistorySummarizationModule
from .identity_history_summarization_module import IdentityHistorySummarizationModule
from .lstm_history_summarization_module import LSTMHistorySummarizationModule
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,8 @@
# LICENSE file in the root directory of this source tree.
#

# pyre-strict

from abc import ABC, abstractmethod
from typing import Optional

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,8 @@
# LICENSE file in the root directory of this source tree.
#

# pyre-strict

from typing import Optional

import torch
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,8 @@
# LICENSE file in the root directory of this source tree.
#

# pyre-strict

from typing import Optional

import torch
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,8 @@
# LICENSE file in the root directory of this source tree.
#

# pyre-strict

from typing import Optional

import torch
Expand Down
2 changes: 2 additions & 0 deletions pearl/neural_networks/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,3 +3,5 @@
#
# This source code is licensed under the MIT license found in the
# LICENSE file in the root directory of this source tree.

# pyre-strict
2 changes: 2 additions & 0 deletions pearl/neural_networks/common/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,8 @@
# This source code is licensed under the MIT license found in the
# LICENSE file in the root directory of this source tree.

# pyre-strict

from .epistemic_neural_networks import Ensemble, EpistemicNeuralNetwork, MLPWithPrior
from .residual_wrapper import ResidualWrapper
from .value_networks import ValueNetwork, VanillaCNN, VanillaValueNetwork
Expand Down
2 changes: 2 additions & 0 deletions pearl/neural_networks/common/epistemic_neural_networks.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,8 @@
# LICENSE file in the root directory of this source tree.
#

# pyre-strict

"""
This module defines epistemic neural networks that can model posterior distributions
and perform bayesian updates via deep learning
Expand Down
2 changes: 2 additions & 0 deletions pearl/neural_networks/common/residual_wrapper.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,8 @@
# LICENSE file in the root directory of this source tree.
#

# pyre-strict

import torch
from torch import nn

Expand Down
2 changes: 2 additions & 0 deletions pearl/neural_networks/common/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,8 @@
# LICENSE file in the root directory of this source tree.
#

# pyre-strict

import logging
from typing import Any, Dict, List, Optional, Union

Expand Down
2 changes: 2 additions & 0 deletions pearl/neural_networks/common/value_networks.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,8 @@
# LICENSE file in the root directory of this source tree.
#

# pyre-strict

"""
This module defines several types of value neural networks.
"""
Expand Down
2 changes: 2 additions & 0 deletions pearl/neural_networks/contextual_bandit/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,8 @@
# This source code is licensed under the MIT license found in the
# LICENSE file in the root directory of this source tree.

# pyre-strict

from .base_cb_model import MuSigmaCBModel
from .linear_regression import LinearRegression
from .neural_linear_regression import NeuralLinearRegression
Expand Down
1 change: 1 addition & 0 deletions pearl/neural_networks/contextual_bandit/base_cb_model.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
# pyre-strict
from abc import abstractmethod

import torch
Expand Down
2 changes: 2 additions & 0 deletions pearl/neural_networks/contextual_bandit/linear_regression.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,8 @@
# LICENSE file in the root directory of this source tree.
#

# pyre-strict

import logging
from typing import Optional, Tuple

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,8 @@
# LICENSE file in the root directory of this source tree.
#

# pyre-strict

import logging
from typing import Dict, List, Optional

Expand Down
2 changes: 2 additions & 0 deletions pearl/neural_networks/sequential_decision_making/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,8 @@
# This source code is licensed under the MIT license found in the
# LICENSE file in the root directory of this source tree.

# pyre-strict

from .actor_networks import (
ActorNetwork,
DynamicActionActorNetwork,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,8 @@
# LICENSE file in the root directory of this source tree.
#

# pyre-strict

"""
This module defines several types of actor neural networks.
"""
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,8 @@
# LICENSE file in the root directory of this source tree.
#

# pyre-strict

"""
This file defines PEARL neural network interafaces
User is free to define their own Q(s, a), but would need to inherit from this interface
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,8 @@
# LICENSE file in the root directory of this source tree.
#

# pyre-strict

import inspect
from typing import Callable, Iterable, Tuple, Type

Expand Down
2 changes: 2 additions & 0 deletions pearl/pearl_agent.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,8 @@
# LICENSE file in the root directory of this source tree.
#

# pyre-strict

import typing
from typing import Any, Dict, Optional

Expand Down
2 changes: 2 additions & 0 deletions pearl/policy_learners/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,8 @@
# This source code is licensed under the MIT license found in the
# LICENSE file in the root directory of this source tree.

# pyre-strict

from .policy_learner import PolicyLearner

__all__ = ["PolicyLearner"]
2 changes: 2 additions & 0 deletions pearl/policy_learners/contextual_bandits/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,8 @@
# This source code is licensed under the MIT license found in the
# LICENSE file in the root directory of this source tree.

# pyre-strict

from .contextual_bandit_base import ContextualBanditBase
from .disjoint_bandit import DisjointBanditContainer
from .disjoint_linear_bandit import DisjointLinearBandit
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,8 @@
# LICENSE file in the root directory of this source tree.
#

# pyre-strict

from abc import abstractmethod
from typing import Any, Dict, Optional

Expand Down
2 changes: 2 additions & 0 deletions pearl/policy_learners/contextual_bandits/disjoint_bandit.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,8 @@
# LICENSE file in the root directory of this source tree.
#

# pyre-strict

from typing import Any, Dict, List, Optional

import torch
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,8 @@
# LICENSE file in the root directory of this source tree.
#

# pyre-strict

from typing import Any, Dict, List

import torch
Expand Down
2 changes: 2 additions & 0 deletions pearl/policy_learners/contextual_bandits/linear_bandit.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,8 @@
# LICENSE file in the root directory of this source tree.
#

# pyre-strict

from typing import Any, Dict, Optional

import torch
Expand Down
2 changes: 2 additions & 0 deletions pearl/policy_learners/contextual_bandits/neural_bandit.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,8 @@
# LICENSE file in the root directory of this source tree.
#

# pyre-strict

from typing import Any, Dict, List, Optional

import torch
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,8 @@
# LICENSE file in the root directory of this source tree.
#

# pyre-strict

from typing import Any, Dict, List, Optional

import torch
Expand Down
Loading

0 comments on commit 20da07c

Please sign in to comment.