Skip to content

Instantly share code, notes, and snippets.

View guillermogotre's full-sized avatar

Guillermo Gómez guillermogotre

  • Granada
View GitHub Profile
@guillermogotre
guillermogotre / unnormalize.py
Created March 20, 2022 15:44
PyTorch Torchvision UnNormalize (reverse Normalize)
import torchvision
class UnNormalize(torchvision.transforms.Normalize):
def __init__(self,mean,std,*args,**kwargs):
new_mean = [-m/s for m,s in zip(mean,std)]
new_std = [1/s for s in std]
super().__init__(new_mean, new_std, *args, **kwargs)
# imagenet_norm = dict(mean=[0.485, 0.456, 0.406],std=[0.229, 0.224, 0.225])
# UnNormalize(**imagenet_norm)
@guillermogotre
guillermogotre / helper.html
Created November 11, 2017 18:10
HackerRank - The Bomberman Game / Helper
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>Title</title>
<style>
td{
border: 1px black solid;
width: 20px;
height: 20px;
@guillermogotre
guillermogotre / Solution.java
Created November 10, 2017 20:49
HackerRank - Algorithm / Implementation / Queen's Attack
import java.io.*;
import java.util.*;
import java.text.*;
import java.math.*;
import java.util.regex.*;
public class Solution {
public static void main(String[] args) {
Scanner in = new Scanner(System.in);
@guillermogotre
guillermogotre / main.cpp
Last active May 5, 2016 01:07
Examen Grupo F MP - UGR
/**
Autor: Guillermo G.
DNI: XXXXXXXX-Z
Grupo: XX
**/
/**
@file main.cpp
@brief
Universidad de Granada