This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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') |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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[][]; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
__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 |