python_code stringlengths 0 187k | repo_name stringlengths 8 46 | file_path stringlengths 6 135 |
|---|---|---|
import os
from abc import ABC
from typing import Dict, Any, List, Optional, Sequence
import gym
import habitat
import torch
from allenact.base_abstractions.experiment_config import MachineParams
from allenact.base_abstractions.preprocessor import SensorPreprocessorGraph
from allenact.base_abstractions.sensor import S... | ask4help-main | projects/pointnav_baselines/experiments/habitat/pointnav_habitat_base.py |
from allenact_plugins.habitat_plugin.habitat_sensors import (
RGBSensorHabitat,
TargetCoordinatesSensorHabitat,
DepthSensorHabitat,
)
from projects.pointnav_baselines.experiments.habitat.debug_pointnav_habitat_base import (
DebugPointNavHabitatBaseConfig,
)
from projects.pointnav_baselines.experiments.p... | ask4help-main | projects/pointnav_baselines/experiments/habitat/debug_pointnav_habitat_rgbd_simpleconvgru_ddppo.py |
from allenact_plugins.habitat_plugin.habitat_sensors import (
RGBSensorHabitat,
TargetCoordinatesSensorHabitat,
)
from projects.pointnav_baselines.experiments.habitat.debug_pointnav_habitat_base import (
DebugPointNavHabitatBaseConfig,
)
from projects.pointnav_baselines.experiments.pointnav_habitat_mixin_dd... | ask4help-main | projects/pointnav_baselines/experiments/habitat/debug_pointnav_habitat_rgb_simpleconvgru_ddppo.py |
import torch
import torch.optim as optim
from torch.optim.lr_scheduler import LambdaLR
from allenact.algorithms.onpolicy_sync.losses.imitation import Imitation
from allenact.base_abstractions.sensor import ExpertActionSensor
from allenact.utils.experiment_utils import (
Builder,
PipelineStage,
TrainingPipe... | ask4help-main | projects/pointnav_baselines/experiments/habitat/debug_pointnav_habitat_rgb_simpleconvgru_bc.py |
from allenact_plugins.habitat_plugin.habitat_sensors import (
DepthSensorHabitat,
TargetCoordinatesSensorHabitat,
)
from projects.pointnav_baselines.experiments.habitat.pointnav_habitat_base import (
PointNavHabitatBaseConfig,
)
from projects.pointnav_baselines.experiments.pointnav_habitat_mixin_ddppo impor... | ask4help-main | projects/pointnav_baselines/experiments/habitat/pointnav_habitat_depth_simpleconvgru_ddppo.py |
import os
from abc import ABC
import habitat
import torch
from allenact_plugins.habitat_plugin.habitat_constants import (
HABITAT_DATASETS_DIR,
HABITAT_CONFIGS_DIR,
)
from projects.pointnav_baselines.experiments.habitat.pointnav_habitat_base import (
PointNavHabitatBaseConfig,
)
class DebugPointNavHabit... | ask4help-main | projects/pointnav_baselines/experiments/habitat/debug_pointnav_habitat_base.py |
from allenact_plugins.ithor_plugin.ithor_sensors import RGBSensorThor
from allenact_plugins.robothor_plugin.robothor_sensors import (
DepthSensorThor,
GPSCompassSensorRoboThor,
)
from projects.pointnav_baselines.experiments.ithor.pointnav_ithor_base import (
PointNaviThorBaseConfig,
)
from projects.pointna... | ask4help-main | projects/pointnav_baselines/experiments/ithor/pointnav_ithor_rgbd_simpleconvgru_ddppo.py |
ask4help-main | projects/pointnav_baselines/experiments/ithor/__init__.py | |
from allenact_plugins.robothor_plugin.robothor_sensors import (
DepthSensorThor,
GPSCompassSensorRoboThor,
)
from projects.pointnav_baselines.experiments.ithor.pointnav_ithor_base import (
PointNaviThorBaseConfig,
)
from projects.pointnav_baselines.experiments.pointnav_mixin_simpleconvgru import (
Point... | ask4help-main | projects/pointnav_baselines/experiments/ithor/pointnav_ithor_depth_simpleconvgru_ddppo_and_gbc.py |
from allenact_plugins.ithor_plugin.ithor_sensors import RGBSensorThor
from allenact_plugins.robothor_plugin.robothor_sensors import GPSCompassSensorRoboThor
from projects.pointnav_baselines.experiments.ithor.pointnav_ithor_base import (
PointNaviThorBaseConfig,
)
from projects.pointnav_baselines.experiments.pointna... | ask4help-main | projects/pointnav_baselines/experiments/ithor/pointnav_ithor_rgb_simpleconvgru_ddppo.py |
import os
from abc import ABC
from projects.pointnav_baselines.experiments.pointnav_thor_base import (
PointNavThorBaseConfig,
)
class PointNaviThorBaseConfig(PointNavThorBaseConfig, ABC):
"""The base config for all iTHOR PointNav experiments."""
NUM_PROCESSES = 40
TRAIN_DATASET_DIR = os.path.join(... | ask4help-main | projects/pointnav_baselines/experiments/ithor/pointnav_ithor_base.py |
from allenact_plugins.robothor_plugin.robothor_sensors import (
DepthSensorThor,
GPSCompassSensorRoboThor,
)
from projects.pointnav_baselines.experiments.ithor.pointnav_ithor_base import (
PointNaviThorBaseConfig,
)
from projects.pointnav_baselines.experiments.pointnav_mixin_simpleconvgru import (
Point... | ask4help-main | projects/pointnav_baselines/experiments/ithor/pointnav_ithor_depth_simpleconvgru_ddppo.py |
from typing import Tuple, Dict, Optional, Union, List, cast
import gym
import torch
import torch.nn as nn
from gym.spaces.dict import Dict as SpaceDict
from allenact.algorithms.onpolicy_sync.policy import ObservationType
from allenact.embodiedai.models.basic_models import SimpleCNN
import allenact.embodiedai.models.r... | ask4help-main | projects/pointnav_baselines/models/point_nav_models.py |
ask4help-main | projects/pointnav_baselines/models/__init__.py | |
import os
from typing import Dict, Any, List, Optional, Sequence
import gym
import torch
import torch.nn as nn
import torch.optim as optim
from torch.optim.lr_scheduler import LambdaLR
from torchvision import models
from allenact.algorithms.onpolicy_sync.losses import PPO
from allenact.algorithms.onpolicy_sync.losses... | ask4help-main | projects/tutorials/pointnav_habitat_rgb_ddppo.py |
# literate: tutorials/running-inference-on-a-pretrained-model.md
# %%
"""# Tutorial: Inference with a pre-trained model."""
# %%
"""
In this tutorial we will run inference on a pre-trained model for the PointNav task
in the RoboTHOR environment. In this task the agent is tasked with going to a specific location
within... | ask4help-main | projects/tutorials/running_inference_tutorial.py |
import torch
import torch.optim as optim
from torch.optim.lr_scheduler import LambdaLR
from allenact.algorithms.onpolicy_sync.losses import PPO
from allenact.algorithms.onpolicy_sync.losses.imitation import Imitation
from allenact.algorithms.onpolicy_sync.losses.ppo import PPOConfig
from allenact.utils.experiment_util... | ask4help-main | projects/tutorials/object_nav_ithor_dagger_then_ppo_one_object.py |
# literate: tutorials/offpolicy-tutorial.md
# %%
"""# Tutorial: Off-policy training."""
# %%
"""
**Note** The provided commands to execute in this tutorial assume you have
[installed the full library](../installation/installation-allenact.md#full-library) and the `extra_requirements`
for the `babyai_plugin` and `mini... | ask4help-main | projects/tutorials/minigrid_offpolicy_tutorial.py |
from math import ceil
from typing import Dict, Any, List, Optional
import gym
import numpy as np
import torch
import torch.nn as nn
import torch.optim as optim
from torch.optim.lr_scheduler import LambdaLR
from allenact.algorithms.onpolicy_sync.losses import PPO
from allenact.algorithms.onpolicy_sync.losses.ppo impor... | ask4help-main | projects/tutorials/navtopartner_robothor_rgb_ppo.py |
# literate: tutorials/gym-tutorial.md
# %%
"""# Tutorial: OpenAI gym for continuous control."""
# %%
"""
**Note** The provided commands to execute in this tutorial assume you have
[installed the full library](../installation/installation-allenact.md#full-library) and the requirements for the
`gym_plugin`. The latter c... | ask4help-main | projects/tutorials/gym_tutorial.py |
# literate: tutorials/gym-mujoco-tutorial.md
# %%
"""# Tutorial: OpenAI gym MuJoCo environment."""
# %%
"""
**Note** The provided commands to execute in this tutorial assume you have
[installed the full library](../installation/installation-allenact.md#full-library) and the requirements for the
`gym_plugin`. The latte... | ask4help-main | projects/tutorials/gym_mujoco_tutorial.py |
ask4help-main | projects/tutorials/__init__.py | |
import glob
import os
from math import ceil
from typing import Dict, Any, List, Optional, Sequence
import gym
import numpy as np
import torch
import torch.nn as nn
import torch.optim as optim
from torch.optim.lr_scheduler import LambdaLR
from torchvision import models
from allenact.algorithms.onpolicy_sync.losses imp... | ask4help-main | projects/tutorials/pointnav_ithor_rgb_ddppo.py |
from projects.tutorials.object_nav_ithor_dagger_then_ppo_one_object import (
ObjectNavThorDaggerThenPPOExperimentConfig,
)
from allenact.utils.viz_utils import (
VizSuite,
TrajectoryViz,
AgentViewViz,
ActorViz,
TensorViz1D,
)
from allenact_plugins.ithor_plugin.ithor_viz import ThorViz
class Ob... | ask4help-main | projects/tutorials/object_nav_ithor_dagger_then_ppo_one_object_viz.py |
# literate: tutorials/training-a-pointnav-model.md
# %%
"""# Tutorial: PointNav in RoboTHOR."""
# %%
"""

## Introduction
One of the most obvious tasks that an embodied agent should master is navigating the world it inhabits.
Before we can teach a robot to cook or clean it f... | ask4help-main | projects/tutorials/training_a_pointnav_model.py |
from math import ceil
from typing import Dict, Any, List, Optional
import gym
import numpy as np
import torch
import torch.nn as nn
import torch.optim as optim
from torch.optim.lr_scheduler import LambdaLR
from allenact.algorithms.onpolicy_sync.losses import PPO
from allenact.algorithms.onpolicy_sync.losses.ppo impor... | ask4help-main | projects/tutorials/object_nav_ithor_ppo_one_object.py |
# literate: tutorials/distributed-objectnav-tutorial.md
# %%
"""# Tutorial: Distributed training across multiple nodes."""
# %%
"""
**Note** The provided commands to execute in this tutorial assume include a configuration script to
[clone the full library](../installation/installation-allenact.md#full-library). Settin... | ask4help-main | projects/tutorials/distributed_objectnav_tutorial.py |
# literate: tutorials/minigrid-tutorial.md
# %%
"""# Tutorial: Navigation in MiniGrid."""
# %%
"""
In this tutorial, we will train an agent to complete the `MiniGrid-Empty-Random-5x5-v0` task within the
[MiniGrid](https://github.com/maximecb/gym-minigrid) environment. We will demonstrate how to:
* Write an experiment... | ask4help-main | projects/tutorials/minigrid_tutorial.py |
from typing import Dict, Optional, List, Any, cast, Callable, Union, Tuple
import gym
import numpy as np
import torch
import torch.nn as nn
import torch.optim as optim
from gym_minigrid.envs import EmptyRandomEnv5x5
from gym_minigrid.minigrid import MiniGridEnv
from torch.optim.lr_scheduler import LambdaLR
from allen... | ask4help-main | projects/tutorials/minigrid_tutorial_conds.py |
ask4help-main | projects/manipulathor_baselines/__init__.py | |
ask4help-main | projects/manipulathor_baselines/armpointnav_baselines/__init__.py | |
import platform
from abc import ABC
from math import ceil
from typing import Dict, Any, List, Optional, Sequence
import gym
import numpy as np
import torch
from allenact.base_abstractions.experiment_config import MachineParams
from allenact.base_abstractions.preprocessor import SensorPreprocessorGraph
from allenact.ba... | ask4help-main | projects/manipulathor_baselines/armpointnav_baselines/experiments/armpointnav_thor_base.py |
from abc import ABC
from typing import Optional, Sequence, Union
from allenact.base_abstractions.experiment_config import ExperimentConfig
from allenact.base_abstractions.preprocessor import Preprocessor
from allenact.base_abstractions.sensor import Sensor
from allenact.utils.experiment_utils import Builder
class Ar... | ask4help-main | projects/manipulathor_baselines/armpointnav_baselines/experiments/armpointnav_base.py |
import torch.optim as optim
from allenact.algorithms.onpolicy_sync.losses import PPO
from allenact.algorithms.onpolicy_sync.losses.ppo import PPOConfig
from allenact.utils.experiment_utils import (
Builder,
PipelineStage,
TrainingPipeline,
LinearDecay,
)
from torch.optim.lr_scheduler import LambdaLR
fr... | ask4help-main | projects/manipulathor_baselines/armpointnav_baselines/experiments/armpointnav_mixin_ddppo.py |
ask4help-main | projects/manipulathor_baselines/armpointnav_baselines/experiments/__init__.py | |
from typing import Sequence, Union
import gym
import torch.nn as nn
from allenact.base_abstractions.preprocessor import Preprocessor
from allenact.utils.experiment_utils import Builder
from projects.manipulathor_baselines.armpointnav_baselines.experiments.armpointnav_base import (
ArmPointNavBaseConfig,
)
from pro... | ask4help-main | projects/manipulathor_baselines/armpointnav_baselines/experiments/armpointnav_mixin_simplegru.py |
from allenact_plugins.manipulathor_plugin.manipulathor_constants import ENV_ARGS
from allenact_plugins.manipulathor_plugin.manipulathor_sensors import (
NoVisionSensorThor,
RelativeAgentArmToObjectSensor,
RelativeObjectToGoalSensor,
PickedUpObjSensor,
)
from allenact_plugins.manipulathor_plugin.manipula... | ask4help-main | projects/manipulathor_baselines/armpointnav_baselines/experiments/ithor/armpointnav_no_vision.py |
from abc import ABC
from allenact_plugins.manipulathor_plugin.armpointnav_constants import (
TRAIN_OBJECTS,
TEST_OBJECTS,
)
from projects.manipulathor_baselines.armpointnav_baselines.experiments.armpointnav_thor_base import (
ArmPointNavThorBaseConfig,
)
class ArmPointNaviThorBaseConfig(ArmPointNavThorBa... | ask4help-main | projects/manipulathor_baselines/armpointnav_baselines/experiments/ithor/armpointnav_ithor_base.py |
from allenact_plugins.manipulathor_plugin.manipulathor_constants import ENV_ARGS
from allenact_plugins.manipulathor_plugin.manipulathor_sensors import (
DepthSensorThor,
RelativeAgentArmToObjectSensor,
RelativeObjectToGoalSensor,
PickedUpObjSensor,
)
from allenact_plugins.manipulathor_plugin.manipulatho... | ask4help-main | projects/manipulathor_baselines/armpointnav_baselines/experiments/ithor/armpointnav_depth.py |
ask4help-main | projects/manipulathor_baselines/armpointnav_baselines/experiments/ithor/__init__.py | |
from allenact_plugins.ithor_plugin.ithor_sensors import RGBSensorThor
from allenact_plugins.manipulathor_plugin.manipulathor_constants import ENV_ARGS
from allenact_plugins.manipulathor_plugin.manipulathor_sensors import (
RelativeAgentArmToObjectSensor,
RelativeObjectToGoalSensor,
PickedUpObjSensor,
)
from... | ask4help-main | projects/manipulathor_baselines/armpointnav_baselines/experiments/ithor/armpointnav_rgb.py |
from allenact_plugins.ithor_plugin.ithor_sensors import RGBSensorThor
from allenact_plugins.manipulathor_plugin.manipulathor_constants import ENV_ARGS
from allenact_plugins.manipulathor_plugin.manipulathor_sensors import (
DepthSensorThor,
RelativeAgentArmToObjectSensor,
RelativeObjectToGoalSensor,
Pick... | ask4help-main | projects/manipulathor_baselines/armpointnav_baselines/experiments/ithor/armpointnav_rgbdepth.py |
import gym
import torch.nn as nn
from allenact_plugins.manipulathor_plugin.manipulathor_constants import ENV_ARGS
from allenact_plugins.manipulathor_plugin.manipulathor_task_samplers import (
ArmPointNavTaskSampler,
)
from projects.manipulathor_baselines.armpointnav_baselines.experiments.ithor.armpointnav_depth im... | ask4help-main | projects/manipulathor_baselines/armpointnav_baselines/experiments/ithor/armpointnav_disjoint_depth.py |
"""Baseline models for use in the Arm Point Navigation task.
Arm Point Navigation is currently available as a Task in ManipulaTHOR.
"""
from typing import Tuple, Optional
import gym
import torch
from allenact.algorithms.onpolicy_sync.policy import (
ActorCriticModel,
LinearCriticHead,
LinearActorHead,
... | ask4help-main | projects/manipulathor_baselines/armpointnav_baselines/models/arm_pointnav_models.py |
import torch
import torch.nn as nn
class LinearActorHeadNoCategory(nn.Module):
def __init__(self, num_inputs: int, num_outputs: int):
super().__init__()
self.linear = nn.Linear(num_inputs, num_outputs)
nn.init.orthogonal_(self.linear.weight, gain=0.01)
nn.init.constant_(self.linea... | ask4help-main | projects/manipulathor_baselines/armpointnav_baselines/models/base_models.py |
ask4help-main | projects/manipulathor_baselines/armpointnav_baselines/models/__init__.py | |
"""Baseline models for use in the Arm Point Navigation task.
Arm Point Navigation is currently available as a Task in ManipulaTHOR.
"""
from typing import Tuple, Optional
import gym
import torch
from allenact.algorithms.onpolicy_sync.policy import (
ActorCriticModel,
LinearCriticHead,
DistributionType,
... | ask4help-main | projects/manipulathor_baselines/armpointnav_baselines/models/disjoint_arm_pointnav_models.py |
import pdb
import torch.nn as nn
import torch.nn.functional as F
def upshuffle(
in_planes, out_planes, upscale_factor, kernel_size=3, stride=1, padding=1
):
return nn.Sequential(
nn.Conv2d(
in_planes,
out_planes * upscale_factor ** 2,
kernel_size=kernel_size,
... | ask4help-main | projects/manipulathor_baselines/armpointnav_baselines/models/manipulathor_net_utils.py |
### THIS FILE ORIGINALLY LOCATED AT '/home/kunals/eai_proj/clip_model/allenact/projects/objectnav_baselines/experiments/robothor/objectnav_robothor_rgb_resnet50gru_ddppo.py'
from allenact_plugins.ithor_plugin.ithor_sensors import (
RGBSensorThor,
GoalObjectTypeThorSensor,
)
from projects.objectnav_baselines.ex... | ask4help-main | experiment_output/used_configs/Objectnav-RoboTHOR-RGB-ResNet50GRU-DDPPO/2022-02-10_14-00-37/objectnav_robothor_rgb_resnet50gru_ddppo.py |
### THIS FILE ORIGINALLY LOCATED AT '/home/kunals/eai_proj/clip_model/allenact/projects/objectnav_baselines/experiments/robothor/objectnav_robothor_base.py'
import os
from abc import ABC
from typing import Optional, List, Any, Dict
import torch
from allenact.utils.misc_utils import prepare_locals_for_super
from proj... | ask4help-main | experiment_output/used_configs/Objectnav-RoboTHOR-RGB-ResNet50GRU-DDPPO/2022-02-10_14-00-37/objectnav_robothor_base.py |
### THIS FILE ORIGINALLY LOCATED AT '/home/kunals/eai_proj/clip_model/allenact/projects/objectnav_baselines/experiments/objectnav_thor_base.py'
import glob
import os
import platform
from abc import ABC
from math import ceil
from typing import Dict, Any, List, Optional, Sequence, Tuple, cast
import gym
import numpy as... | ask4help-main | experiment_output/used_configs/Objectnav-RoboTHOR-RGB-ResNet50GRU-DDPPO/2022-02-10_14-00-37/objectnav_thor_base.py |
### THIS FILE ORIGINALLY LOCATED AT '/home/kunals/eai_proj/clip_model/allenact/projects/objectnav_baselines/experiments/objectnav_mixin_resnetgru.py'
from typing import Sequence, Union
import gym
import torch.nn as nn
from torchvision import models
from allenact.base_abstractions.preprocessor import Preprocessor
fro... | ask4help-main | experiment_output/used_configs/Objectnav-RoboTHOR-RGB-ResNet50GRU-DDPPO/2022-02-10_14-00-37/objectnav_mixin_resnetgru.py |
### THIS FILE ORIGINALLY LOCATED AT '/home/kunals/eai_proj/clip_model/allenact/projects/objectnav_baselines/experiments/objectnav_base.py'
from abc import ABC
from typing import Optional, Sequence, Union
from allenact.base_abstractions.experiment_config import ExperimentConfig
from allenact.base_abstractions.preproce... | ask4help-main | experiment_output/used_configs/Objectnav-RoboTHOR-RGB-ResNet50GRU-DDPPO/2022-02-10_14-00-37/objectnav_base.py |
### THIS FILE ORIGINALLY LOCATED AT '/home/kunals/eai_proj/clip_model/allenact/projects/objectnav_baselines/experiments/objectnav_mixin_ddppo.py'
from typing import Dict, Tuple
import torch
import torch.optim as optim
from torch.optim.lr_scheduler import LambdaLR
from allenact.algorithms.onpolicy_sync.losses.abstract... | ask4help-main | experiment_output/used_configs/Objectnav-RoboTHOR-RGB-ResNet50GRU-DDPPO/2022-02-10_14-00-37/objectnav_mixin_ddppo.py |
### THIS FILE ORIGINALLY LOCATED AT '/usr/lib/python3.8/abc.py'
# Copyright 2007 Google, Inc. All Rights Reserved.
# Licensed to PSF under a Contributor Agreement.
"""Abstract Base Classes (ABCs) according to PEP 3119."""
def abstractmethod(funcobj):
"""A decorator indicating abstract methods.
Requires tha... | ask4help-main | experiment_output/used_configs/Objectnav-RoboTHOR-RGB-ResNet50GRU-DDPPO/2022-02-10_14-00-37/abc.py |
import json
import os
import re
import shutil
import sys
from pathlib import Path
from urllib.request import urlopen
from more_itertools import all_equal
DATASET_DIR = os.path.abspath(os.path.dirname(Path(__file__)))
def get_habitat_download_info(allow_create: bool = False):
"""Get a dictionary giving a specifi... | ask4help-main | datasets/.habitat_downloader_helper.py |
ask4help-main | tests/__init__.py | |
ask4help-main | tests/mapping/__init__.py | |
import os
import platform
import random
import sys
import urllib
import urllib.request
import warnings
from collections import defaultdict
# noinspection PyUnresolvedReferences
from tempfile import mkdtemp
from typing import Dict, List, Tuple, cast
# noinspection PyUnresolvedReferences
import ai2thor
# noinspection ... | ask4help-main | tests/mapping/test_ai2thor_mapping.py |
from typing import Dict, Any
import torch.multiprocessing as mp
import torch.nn as nn
from allenact.base_abstractions.experiment_config import ExperimentConfig
from allenact.base_abstractions.task import TaskSampler
from allenact.utils.experiment_utils import TrainingPipeline
# noinspection PyAbstractClass,PyTypeCh... | ask4help-main | tests/multiprocessing/test_frozen_attribs.py |
ask4help-main | tests/multiprocessing/__init__.py | |
ask4help-main | tests/utils/__init__.py | |
import warnings
from collections import OrderedDict
from typing import Tuple
import numpy as np
import torch
from gym import spaces as gyms
from allenact.utils import spaces_utils as su
class TestSpaces(object):
space = gyms.Dict(
{
"first": gyms.Tuple(
[
... | ask4help-main | tests/utils/test_spaces.py |
import hashlib
import os
import imageio
import numpy as np
from torchvision.transforms import transforms
from allenact.utils.tensor_utils import ScaleBothSides
from constants import ABS_PATH_OF_TOP_LEVEL_DIR
to_pil = transforms.ToPILImage() # Same as used by the vision sensors
class TestPillowRescaling(object):
... | ask4help-main | tests/vision/test_pillow_rescaling.py |
ask4help-main | tests/vision/__init__.py | |
import math
import os
from allenact.algorithms.onpolicy_sync.runner import OnPolicyRunner
from projects.babyai_baselines.experiments.go_to_obj.ppo import (
PPOBabyAIGoToObjExperimentConfig,
)
class TestGoToObjTrains(object):
def test_ppo_trains(self, tmpdir):
cfg = PPOBabyAIGoToObjExperimentConfig()
... | ask4help-main | tests/sync_algs_cpu/test_to_to_obj_trains.py |
ask4help-main | tests/sync_algs_cpu/__init__.py | |
from allenact_plugins.manipulathor_plugin.arm_calculation_utils import (
world_coords_to_agent_coords,
)
class TestArmCalculationUtils(object):
def test_translation_functions(self):
agent_coordinate = {
"position": {"x": 1, "y": 0, "z": 2},
"rotation": {"x": 0, "y": -45, "z": 0... | ask4help-main | tests/manipulathor_plugin/test_utils.py |
from typing import Dict, Optional, List, Any, cast
import os
import gym
from gym_minigrid.envs import EmptyRandomEnv5x5
from torch import nn
from torch import optim
from torch.optim.lr_scheduler import LambdaLR
from allenact.algorithms.onpolicy_sync.losses.ppo import PPO, PPOConfig
from allenact.base_abstractions.exp... | ask4help-main | tests/hierarchical_policies/test_minigrid_conditional.py |
ask4help-main | tests/hierarchical_policies/__init__.py | |
import os
from pathlib import Path
ALLENACT_INSTALL_DIR = os.path.abspath(os.path.dirname(Path(__file__)))
| ask4help-main | allenact/_constants.py |
try:
from allenact._version import __version__
except ModuleNotFoundError:
__version__ = None
| ask4help-main | allenact/__init__.py |
import os
from pathlib import Path
from setuptools import find_packages, setup
def parse_req_file(fname, initial=None):
"""Reads requires.txt file generated by setuptools and outputs a
new/updated dict of extras as keys and corresponding lists of dependencies
as values.
The input file's contents are... | ask4help-main | allenact/setup.py |
"""Entry point to training/validating/testing for a user given experiment
name."""
import argparse
import ast
import importlib
import inspect
import json
import os
from typing import Dict, Tuple, List, Optional, Type
from setproctitle import setproctitle as ptitle
from allenact import __version__
from allenact.algor... | ask4help-main | allenact/main.py |
ask4help-main | allenact/embodiedai/__init__.py | |
ask4help-main | allenact/embodiedai/mapping/__init__.py | |
import torch
from torch.nn import functional as F
from allenact.algorithms.onpolicy_sync.losses.abstract_loss import (
AbstractActorCriticLoss,
)
from allenact.algorithms.onpolicy_sync.policy import ObservationType
from allenact.base_abstractions.distributions import CategoricalDistr
from allenact.base_abstraction... | ask4help-main | allenact/embodiedai/mapping/mapping_losses.py |
ask4help-main | allenact/embodiedai/mapping/mapping_utils/__init__.py | |
# MIT License
#
# Original Copyright (c) 2020 Devendra Chaplot
#
# Modified work Copyright (c) 2021 Allen Institute for Artificial Intelligence
#
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation files (the "Software"), to deal
# in the Softwa... | ask4help-main | allenact/embodiedai/mapping/mapping_utils/map_builders.py |
# MIT License
#
# Original Copyright (c) 2020 Devendra Chaplot
#
# Modified work Copyright (c) 2021 Allen Institute for Artificial Intelligence
#
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation files (the "Software"), to deal
# in the Softwa... | ask4help-main | allenact/embodiedai/mapping/mapping_utils/point_cloud_utils.py |
# MIT License
#
# Original Copyright (c) 2020 Devendra Chaplot
#
# Modified work Copyright (c) 2021 Allen Institute for Artificial Intelligence
#
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation files (the "Software"), to deal
# in the Softwa... | ask4help-main | allenact/embodiedai/mapping/mapping_models/active_neural_slam.py |
ask4help-main | allenact/embodiedai/mapping/mapping_models/__init__.py | |
ask4help-main | allenact/embodiedai/preprocessors/__init__.py | |
from typing import List, Callable, Optional, Any, cast, Dict
import gym
import numpy as np
import torch
import torch.nn as nn
from torchvision import models
from allenact.base_abstractions.preprocessor import Preprocessor
from allenact.utils.misc_utils import prepare_locals_for_super
class ResNetEmbedder(nn.Module)... | ask4help-main | allenact/embodiedai/preprocessors/resnet.py |
from abc import abstractmethod, ABC
from typing import Optional, Tuple, Any, cast, Union, Sequence
import PIL
import gym
import numpy as np
from torchvision import transforms
from allenact.base_abstractions.misc import EnvType
from allenact.base_abstractions.sensor import Sensor
from allenact.base_abstractions.task i... | ask4help-main | allenact/embodiedai/sensors/vision_sensors.py |
ask4help-main | allenact/embodiedai/sensors/__init__.py | |
# Original work Copyright (c) Facebook, Inc. and its affiliates.
# Modified work Copyright (c) Allen Institute for AI
# This source code is licensed under the MIT license found in the
# LICENSE file in the root directory of this source tree.
"""Several of the models defined in this file are modified versions of those
f... | ask4help-main | allenact/embodiedai/models/aux_models.py |
ask4help-main | allenact/embodiedai/models/__init__.py | |
"""Basic building block torch networks that can be used across a variety of
tasks."""
from typing import (
Sequence,
Dict,
Union,
cast,
List,
Callable,
Optional,
Tuple,
Any,
)
import gym
import numpy as np
import torch
from gym.spaces.dict import Dict as SpaceDict
import torch.nn as... | ask4help-main | allenact/embodiedai/models/basic_models.py |
# Original work Copyright (c) Facebook, Inc. and its affiliates.
# Modified work Copyright (c) Allen Institute for AI
# This source code is licensed under the MIT license found in the
# LICENSE file in the root directory of this source tree.
# Adapted from https://github.com/joel99/habitat-pointnav-aux/blob/master/habi... | ask4help-main | allenact/embodiedai/models/resnet.py |
# Original work Copyright (c) Facebook, Inc. and its affiliates.
# Modified work Copyright (c) Allen Institute for AI
# This source code is licensed under the MIT license found in the
# LICENSE file in the root directory of this source tree.
# Adapted from https://github.com/joel99/habitat-pointnav-aux/blob/master/habi... | ask4help-main | allenact/embodiedai/models/fusion_models.py |
from typing import Tuple, Dict, Optional, List
from allenact.utils.system import get_logger
from collections import OrderedDict
import os
import gym
import torch
import torch.nn as nn
from gym.spaces.dict import Dict as SpaceDict
from allenact.algorithms.onpolicy_sync.policy import (
ActorCriticModel,
LinearC... | ask4help-main | allenact/embodiedai/models/visual_nav_models.py |
ask4help-main | allenact/embodiedai/aux_losses/__init__.py | |
# Original work Copyright (c) Facebook, Inc. and its affiliates.
# Modified work Copyright (c) Allen Institute for AI
# This source code is licensed under the MIT license found in the
# LICENSE file in the root directory of this source tree.
"""Defining the auxiliary loss for actor critic type models.
Several of the l... | ask4help-main | allenact/embodiedai/aux_losses/losses.py |
"""Defines the `ExperimentConfig` abstract class used as the basis of all
experiments."""
import abc
from typing import Dict, Any, Optional, List, Union, Sequence, Tuple, cast
import torch
import torch.nn as nn
from allenact.base_abstractions.preprocessor import SensorPreprocessorGraph
from allenact.base_abstraction... | ask4help-main | allenact/base_abstractions/experiment_config.py |
import abc
from typing import (
Dict,
Any,
TypeVar,
Sequence,
NamedTuple,
Optional,
List,
Union,
Generic,
)
import torch
EnvType = TypeVar("EnvType")
DistributionType = TypeVar("DistributionType")
class RLStepResult(NamedTuple):
observation: Optional[Any]
reward: Optional... | ask4help-main | allenact/base_abstractions/misc.py |
# Original work Copyright (c) Facebook, Inc. and its affiliates.
# Modified work Copyright (c) Allen Institute for AI
# This source code is licensed under the MIT license found in the
# LICENSE file in the root directory of this source tree.
"""Defines the primary data structures by which agents interact with their
en... | ask4help-main | allenact/base_abstractions/task.py |
# Original work Copyright (c) Facebook, Inc. and its affiliates.
# Modified work Copyright (c) Allen Institute for AI
# This source code is licensed under the MIT license found in the
# LICENSE file in the root directory of this source tree.
from collections import OrderedDict
from typing import (
Generic,
Dict... | ask4help-main | allenact/base_abstractions/sensor.py |
ask4help-main | allenact/base_abstractions/__init__.py | |
import abc
from typing import List, Any, Dict
from typing import Sequence
from typing import Union
import gym
import networkx as nx
import torch
from gym.spaces import Dict as SpaceDict
from allenact.utils.experiment_utils import Builder
class Preprocessor(abc.ABC):
"""Represents a preprocessor that transforms ... | ask4help-main | allenact/base_abstractions/preprocessor.py |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.