Skip to content

Instantly share code, notes, and snippets.

@gasiort
gasiort / FrozenLake-v0-genetic.py
Created April 14, 2017 13:45
FrozenLake-v0 genetic algorithm solution from Pracitcal RL week0 assignment
# most of the code is taken form Practical RL week0 assignment (https://github.com/yandexdataschool/Practical_RL/tree/master/week0)
# I'm just trying out OpenAI submission interface
import numpy as np
import os
import gym
from gym import wrappers
@gasiort
gasiort / GuidedBackprop.py
Last active February 28, 2018 00:18
guided backprop. w pytorchu
class GuidedBackprop(torch.nn.Module):
def __init__(self, model, n_classes):
super().__init__()
self.model = model
self.n_classes = n_classes
self.gradients = None
self.model.eval()
self.update_relus()
self.hook_first_layer()