Skip to content

Instantly share code, notes, and snippets.

View smsharma's full-sized avatar

Siddharth Mishra-Sharma smsharma

View GitHub Profile
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
import numpy as np
from torch.utils.data import Dataset
def load_and_check(filename, memmap=False):
""" Load numpy array optionally with memmap
"""
if memmap:
data = np.load(filename, mmap_mode="c")
else:
data = np.load(filename)
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
import sys
sys.path.append("../")
from itertools import permutations
import torch
from torch import nn
from torch.distributions import Normal
from torch.nn import CrossEntropyLoss
import pytorch_lightning as pl
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.