Skip to content

Instantly share code, notes, and snippets.

Learning to Learn

Suvojit Manna suvojit-0x55aa

Learning to Learn
View GitHub Profile
suvojit-0x55aa /
Created Sep 30, 2019
Label Smoothing in Pytorch
import torch
import torch.nn as nn
class LabelSmoothing(nn.Module):
NLL loss with label smoothing.
def __init__(self, smoothing=0.0):
Constructor for the LabelSmoothing module.
suvojit-0x55aa /
Created Aug 1, 2019
Python Numpy Gaussian Function
def gauss_map(size_x, size_y=None, sigma_x=5, sigma_y=None):
if size_y == None:
size_y = size_x
if sigma_y == None:
sigma_y = sigma_x
assert isinstance(size_x, int)
assert isinstance(size_y, int)
x0 = size_x // 2
from __future__ import division, print_function
import concurrent.futures as cf
from glob import glob
import logging
import os
from time import time, sleep
import boto3
suvojit-0x55aa /
Created Sep 24, 2017
A Simple Neural Net in Python
import numpy as np
import csv
import matplotlib.pyplot as plt
#fix random seed for reproducibility
#Read Dataset
iris = open('iris.csv','r')
suvojit-0x55aa /
Last active Jul 23, 2016
Determinant of a Matrix Laplace Method
import javax.naming.OperationNotSupportedException;
import java.lang.Exception;
import java.lang.Math;
import java.lang.String;
import java.lang.System;
import java.util.Scanner;
class Matrix
private int mat[][];
suvojit-0x55aa /
Last active Jul 18, 2016
The power of compounding
__author__ = 'Suvojit Manna'
p = float(raw_input())
r = float(raw_input())
t = int(raw_input())
ans = p
r /= 12*100
for i in xrange(1, t):
ans *= 1 + r