Skip to content

Instantly share code, notes, and snippets.

Avatar
💭
Learning to Learn

Suvojit Manna suvojit-0x55aa

💭
Learning to Learn
View GitHub Profile
@suvojit-0x55aa
suvojit-0x55aa / compound.py
Last active Jul 18, 2016
The power of compounding
View compound.py
__author__ = 'Suvojit Manna'
try:
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
@suvojit-0x55aa
suvojit-0x55aa / Det.java
Last active Jul 23, 2016
Determinant of a Matrix Laplace Method
View Det.java
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
suvojit-0x55aa / SimpleNeuralNet.py
Created Sep 24, 2017
A Simple Neural Net in Python
View SimpleNeuralNet.py
import numpy as np
import csv
import matplotlib.pyplot as plt
#fix random seed for reproducibility
np.random.seed(1)
#Read Dataset
iris = open('iris.csv','r')
View aws_upload_script.py
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
suvojit-0x55aa / gaussian.py
Created Aug 1, 2019
Python Numpy Gaussian Function
View gaussian.py
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
@suvojit-0x55aa
suvojit-0x55aa / label_smoothing.py
Created Sep 30, 2019
Label Smoothing in Pytorch
View label_smoothing.py
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.