Skip to content

Instantly share code, notes, and snippets.

View prigoyal's full-sized avatar

Priya Goyal prigoyal

View GitHub Profile
@prigoyal
prigoyal / setup.py
Last active February 28, 2024 14:01
LLM-foundry setup.py without torch
# Copyright 2024 MosaicML LLM Foundry authors
# SPDX-License-Identifier: Apache-2.0
"""MosaicML LLM Foundry package setup."""
import os
import re
import setuptools
from setuptools import setup
@prigoyal
prigoyal / taskonomyencoder.py
Created June 5, 2019 19:04
res5 Taskonomy taskonomyencoder.py
import math
import os
import torch
import torch.nn as nn
import torch.nn.functional as F
import torchvision.models as models
import warnings
TASKONOMY_TASKS = "autoencoder class_1000 class_places curvature denoise edge2d edge3d inpainting_whole jigsaw keypoint2d keypoint3d reshade rgb2depth rgb2sfnorm rgb2mist room_layout segment25d segment2d segmentsemantic vanishing_point".split()
class TaskonomyEncoder(nn.Module):
@prigoyal
prigoyal / taskonomyencoder.py
Created June 5, 2019 19:03
res4 Taskonomy taskonomyencoder.py
import math
import os
import torch
import torch.nn as nn
import torch.nn.functional as F
import torchvision.models as models
import warnings
TASKONOMY_TASKS = "autoencoder class_1000 class_places curvature denoise edge2d edge3d inpainting_whole jigsaw keypoint2d keypoint3d reshade rgb2depth rgb2sfnorm rgb2mist room_layout segment25d segment2d segmentsemantic vanishing_point".split()
class TaskonomyEncoder(nn.Module):
@prigoyal
prigoyal / taskonomyencoder.py
Created June 5, 2019 19:01
res3 Taskonomy taskonomyencoder.py
import math
import os
import torch
import torch.nn as nn
import torch.nn.functional as F
import torchvision.models as models
import warnings
TASKONOMY_TASKS = "autoencoder class_1000 class_places curvature denoise edge2d edge3d inpainting_whole jigsaw keypoint2d keypoint3d reshade rgb2depth rgb2sfnorm rgb2mist room_layout segment25d segment2d segmentsemantic vanishing_point".split()
class TaskonomyEncoder(nn.Module):
@prigoyal
prigoyal / taskonomyencoder.py
Created June 5, 2019 19:00
Taskonomy taskonomyencoder.py
import math
import os
import torch
import torch.nn as nn
import torch.nn.functional as F
import torchvision.models as models
import warnings
TASKONOMY_TASKS = "autoencoder class_1000 class_places curvature denoise edge2d edge3d inpainting_whole jigsaw keypoint2d keypoint3d reshade rgb2depth rgb2sfnorm rgb2mist room_layout segment25d segment2d segmentsemantic vanishing_point".split()
class TaskonomyEncoder(nn.Module):
@prigoyal
prigoyal / architectures.py
Created June 5, 2019 18:49
Taskonomy architectures.py
import torch.nn as nn
from torch.nn import Parameter, ModuleList
import torch.nn.functional as F
import torch
import multiprocessing
import numpy as np
import os
from gym import spaces
from torchvision.models import resnet18
from teas.models.taskonomyencoder import TaskonomyEncoder
@prigoyal
prigoyal / architectures.py
Created June 5, 2019 18:47
Taskonomy architectures.py
import torch.nn as nn
from torch.nn import Parameter, ModuleList
import torch.nn.functional as F
import torch
import multiprocessing
import numpy as np
import os
from gym import spaces
from torchvision.models import resnet18
from teas.models.taskonomyencoder import TaskonomyEncoder
import math
from torch import nn
from torch.nn import init
# pre-trained SRResNet model
model_url = 'https://s3.amazonaws.com/pytorch/demos/srresnet-e10b2039.pth'
# model definition
def _initialize_orthogonal(conv):