Skip to content

Instantly share code, notes, and snippets.

@enijkamp
enijkamp / entropy
Created January 12, 2019 12:14
entropy
0 cs1= 0.2292 cs2= 1.3196 cs1_l= 0.2292 cs2_l= 1.3196 c1= 0.9407 c2= 0.6621
1 cs1= 0.2308 cs2= 1.3286 cs1_l= 0.1636 cs2_l= 1.1018 c1= 0.9634 c2= 0.6934
2 cs1= 0.2333 cs2= 1.3213 cs1_l= 0.1473 cs2_l= 1.0273 c1= 0.9688 c2= 0.7188
3 cs1= 0.2343 cs2= 1.3243 cs1_l= 0.1395 cs2_l= 0.9930 c1= 0.9692 c2= 0.7258
4 cs1= 0.2335 cs2= 1.3321 cs1_l= 0.1339 cs2_l= 0.9786 c1= 0.9734 c2= 0.7244
5 cs1= 0.2314 cs2= 1.3320 cs1_l= 0.1292 cs2_l= 0.9649 c1= 0.9751 c2= 0.7263
6 cs1= 0.2318 cs2= 1.3337 cs1_l= 0.1272 cs2_l= 0.9550 c1= 0.9763 c2= 0.7319
7 cs1= 0.2313 cs2= 1.3411 cs1_l= 0.1246 cs2_l= 0.9546 c1= 0.9788 c2= 0.7273
8 cs1= 0.2301 cs2= 1.3427 cs1_l= 0.1224 cs2_l= 0.9503 c1= 0.9790 c2= 0.7319
9 cs1= 0.2287 cs2= 1.3394 cs1_l= 0.1203 cs2_l= 0.9418 c1= 0.9805 c2= 0.7341
@enijkamp
enijkamp / out
Created January 12, 2019 11:39
out
0 cs1= 0.2207 cs2= 1.3196 c1= 0.9443 c2= 0.6621
1 cs1= 0.2215 cs2= 1.3286 c1= 0.9683 c2= 0.6934
2 cs1= 0.2242 cs2= 1.3213 c1= 0.9744 c2= 0.7188
3 cs1= 0.2252 cs2= 1.3243 c1= 0.9749 c2= 0.7258
4 cs1= 0.2258 cs2= 1.3321 c1= 0.9778 c2= 0.7244
5 cs1= 0.2255 cs2= 1.3320 c1= 0.9788 c2= 0.7263
6 cs1= 0.2247 cs2= 1.3337 c1= 0.9780 c2= 0.7319
7 cs1= 0.2252 cs2= 1.3411 c1= 0.9788 c2= 0.7273
8 cs1= 0.2257 cs2= 1.3427 c1= 0.9800 c2= 0.7319
9 cs1= 0.2249 cs2= 1.3394 c1= 0.9802 c2= 0.7341
@enijkamp
enijkamp / ensemble.py
Created January 12, 2019 11:06
ensemble
import os
import pandas as pd
import numpy as np
import argparse
import torch
import torchvision
import models
@enijkamp
enijkamp / coordconv.py
Created January 11, 2019 08:51
coordconv
class AddCoords(nn.Module):
def __init__(self, with_r=False):
super().__init__()
self.with_r = with_r
def forward(self, input_tensor):
batch_size, _, x_dim, y_dim = input_tensor.size()
xx_channel = torch.arange(x_dim).repeat(1, y_dim, 1)
class AddCoords(nn.Module):
def __init__(self, with_r=False):
super().__init__()
self.with_r = with_r
def forward(self, input_tensor):
batch_size, _, x_dim, y_dim = input_tensor.size()
xx_channel = torch.arange(x_dim).repeat(1, y_dim, 1)
from PIL import Image
import glob
for p in glob.glob('*.png'):
with open(p, 'rb') as f:
img = Image.open(f)
try:
img.convert('RGB')
except:
print(p)
@enijkamp
enijkamp / plot.py
Created December 28, 2018 18:59
minimal dataset
import torch.utils
import torch.nn.utils
from torch.utils import data
from torchvision import transforms
from PIL import Image, ImageDraw
import numpy as np
import torch.utils
import torch.nn.utils
from torch.utils import data
from torchvision import transforms
from PIL import Image, ImageDraw
import numpy as np
20900 en_gen_0= -2.006107 en_gen_1= -2.008458 en_gen_d= -0.002351
20900 en_pos=[ -4.6743] en_neg=[ -1.9059]
20900 en_pos_test=[ -4.3532] en_neg_test=[ -2.4173]
20900 en_pos=[ -4.6743 -4.6741 0.0001] en_neg=[ -1.9059 -1.9036 0.0023]
20900 loss= -2.0061
20900 neg_range=[ 0.0000 0.9999] neg_abs_sum= 239.6976
x_pos_0 = 3 - 3 + 2 + 2
x_pos_0 = 3 - 3 + 2 + 2
x_neg_0 = ( 1 * ( 3 3 3
x_neg_1 = ( ( z ( + 3 3 )
#!/bin/bash
#SBATCH -N 1
#SBATCH -p GPU-shared
#SBATCH --ntasks-per-node 4
#SBATCH --gres=gpu:p100:1
#SBATCH -t 47:00:00
module load python2/2.7.11_gcc
module load cuda/8.0
cd