Skip to content

Instantly share code, notes, and snippets.

Avatar

Flock-Anizak Flock1

  • Anizak
  • India
View GitHub Profile
View fastai_model.py
class UpSample(nn.Module):
def __init__(self,feat_in,feat_out,out_shape=None,scale=2):
super().__init__()
self.conv = nn.Conv2d(feat_in,feat_out,kernel_size=(3,3),stride=1,padding=1)
self.out_shape,self.scale = out_shape,scale
def forward(self,x):
return self.conv(
nn.functional.interpolate(
View model.py
import torch
import torch.nn as nn
import torch.nn.functional as F
import torch.optim as optim
import torchaudio
from torch.autograd import Variable
View error.log
Collecting git+https://github.com/facebookresearch/pytorch3d.git
Cloning https://github.com/facebookresearch/pytorch3d.git to /tmp/pip-req-build-yyykcly2
Running command git clone -q https://github.com/facebookresearch/pytorch3d.git /tmp/pip-req-build-yyykcly2
Requirement already satisfied: torchvision>=0.4 in ./anaconda3/envs/work/lib/python3.8/site-packages (from pytorch3d==0.2.0) (0.6.0a0+82fd1c8)
Processing ./.cache/pip/wheels/a6/c2/56/ce21635637947b871a9b39e6cb33e3f11ec6e65acb8f901ccb/fvcore-0.1.1.post20200716-py3-none-any.whl
Requirement already satisfied: numpy in ./anaconda3/envs/work/lib/python3.8/site-packages (from torchvision>=0.4->pytorch3d==0.2.0) (1.19.1)
Requirement already satisfied: torch in ./anaconda3/envs/work/lib/python3.8/site-packages (from torchvision>=0.4->pytorch3d==0.2.0) (1.5.0)
Requirement already satisfied: pillow>=4.1.1 in ./anaconda3/envs/work/lib/python3.8/site-packages (from torchvision>=0.4->pytorch3d==0.2.0) (7.2.0)
Collecting tqdm
Using cached tqdm-4.48.2-py2.py3-no
View intro.py
import numpy as np
import matplotlib.pyplot as plt
from sklearn.model_selection import train_test_split
from sklearn.utils import shuffle
import tensorflow as tf
from tensorflow import keras
from tensorflow.keras import backend as K
from tensorflow.keras.models import load_model, Sequential
from tensorflow.keras.layers import Dense
from tensorflow.keras.utils import Sequence
View pytorch_load_model.py
class ActorCritic(nn.Module):
def __init__(self, num_inputs, num_outputs, hidden_size, std=0.0):
super(ActorCritic, self).__init__()
self.critic = nn.Sequential(
nn.Linear(num_inputs, hidden_size),
nn.ReLU(),
nn.Linear(hidden_size, 1)
)
View fastai_UNet.py
from torch.utils.data import Dataset, DataLoader
import pandas as pd
import numpy as np
import cv2
import matplotlib.pyplot as plt
import matplotlib.image as mpimg
from sklearn.model_selection import train_test_split
# from fastai.vision.models import resnet34
# from fastai.vision.leaner import unet_learner
from fastai.vision import *
View values.txt
p1_0: [0.5404173787448456, 0.41291281118626466, 1.0, 0.0]
p2_0: [0.4595826212551544, 0.5870871888137354, 0.0, 1.0]
idx_0: ['3FLip X', '5FLip X', '7FLip X', '9FLip X']
p1_1: [0.4595826212551544]
p2_1: [0.5404173787448456]
idx_1: ['4Flip Y']
p1_2: []
p2_2: []
idx_2: []
p1_3: [0.03264615290754886, 0.4595826212551544]
View training.py
def act(self, data,t): #state
rate = self.get_exploration_rate(t)
if random.random() < rate:
options = self.model.predict(data) #state
options = np.squeeze(options)
action = random.randrange(self.action_size)
else:
options = self.model.predict(data) #state
options = np.squeeze(options)
action = options.argmax()
View gist:8c82d180e1e9fd9c01c1cefbb9742d21
Created temporary directory: /tmp/pip-ephem-wheel-cache-h28bm0z4
Created temporary directory: /tmp/pip-req-tracker-a9vehy36
Created requirements tracker '/tmp/pip-req-tracker-a9vehy36'
Created temporary directory: /tmp/pip-install-lla89gd9
Processing /home/sarvagya/Desktop/RBC/box-convolutions
Created temporary directory: /tmp/pip-req-build-k9raxzlj
Added file:///home/sarvagya/Desktop/RBC/box-convolutions to build tracker '/tmp/pip-req-tracker-a9vehy36'
Running setup.py (path:/tmp/pip-req-build-k9raxzlj/setup.py) egg_info for package from file:///home/sarvagya/Desktop/RBC/box-convolutions
Running command python setup.py egg_info
running egg_info
View gist:d03a6d2814099379780cfd7ff9b07ab3
Processing /home/user/Desktop/RBC/box-convolutions
Requirement already satisfied: future in /home/user/anaconda3/envs/tf/lib/python3.6/site-packages (from box-convolution==0.0.0) (0.17.1)
Requirement already satisfied: torch>=1.0.0a0 in /home/user/anaconda3/envs/tf/lib/python3.6/site-packages (from box-convolution==0.0.0) (1.0.1.post2)
Building wheels for collected packages: box-convolution
Running setup.py bdist_wheel for box-convolution ... error
Failed building wheel for box-convolution
Running setup.py clean for box-convolution
Failed to build box-convolution
Installing collected packages: box-convolution
Running setup.py install for box-convolution ... error
You can’t perform that action at this time.