Skip to content

Instantly share code, notes, and snippets.

💭
Trying to find some meaning in this absurd world. Iam14andthisisdeep.

雾雨魔理沙 MarisaKirisame

💭
Trying to find some meaning in this absurd world. Iam14andthisisdeep.
View GitHub Profile
View links.txt
View AD.py
import math
def sin(x):
if isinstance(x, Dual):
return Dual(sin(x.x), cos(x.x) * x.dx)
return math.sin(x)
def cos(x):
if isinstance(x, Dual):
return Dual(cos(x.x), -1 * sin(x.x) * x.dx)
View export
N4IgpgdgLglrYGcDyAjAVmAxlEAuUADgDYCGAnmAE56gBKiNI1+AvgDQiZ4AsADOyADCAV0qVImMo0yjxESXn4cAajAQwA9hEYA3EkWFg8ANgCMAOgCcpgOy9u3AKyWXLgByPHHALYkAHjDewt54dhwkmDJBpLBaiubGvEnJKSmm4ZEAyhqimAy4ANqgCDmUeXggAEIkCEbh3jnQ8QBM7MWl5bhCJN4EAGYw4iD1jTi4vObcLAC6AgCSUGDeCIxwSyv4VSQA5nhFIDAAJhUoOwD6psPgAI7CMAQEYMe46ZwkYjBPeK9r3nMAIjxms1uMYZhw5hBtuJDp8moVQEcKuIEGd1EQANZXMC3e6PZ68DiYd6UT4Eji/AF4NyWADMNlabERzyYiDRMEx2NxDy+4yJJLJigpiz+gNwTkczTBTIOLJR7M5HBxdx55LeH15hIOIqpuGabmaNlpbVlyLZ6KxSu5+KF6tJmuFS11pmatNMSmZZtRFq5KptfLtgoDlLFBusjhNSK68qgJEevrxDsDSZDoWsbjckblbNOEEOKytfqTxI1atTL0cplpEZlUdZqNz+YTqttJftZZ1YsliWlnujbNj8cLibVbaDWvL3FphsZffrZ0HdRuRdHApTnbwjiSzizXoVluXI9ba47TrF3A8Nbn8p9w5bAbH67P30StMsu/7DY0UCgRCXyqPB8T1tcsbFMZxM1rbMGxIPMC0Pe8tUfU9RVCatIOvHNYKbO9/SQ4Dgw3XA7CrDDTU/M5G3ggDEP5UsQKI4wt2rD95yo5s8Lo9sGOfXA6QvMi6xvDkDxozjkxQ3VjENaxWOExUEPE5CeNQ3BHAzcC5IHON/2tYsCInIibEsUEbC01FFw4/T6MI3jKzpUxzIXHSrNXGzDN45p1MsD1yPnSzcOs7jbNUyUTN7PyYxcwK3OCjzVMsQ1eGNKC9wCxSgvHR1VOM8Cr0inNv1/XSV2Pdzst1LzpKmVKKJQIq/1csq4oqsUGQNWcCq/H9Gpi5qsu1XjjP1Gr
View leak.py
import torch
import torch.nn as nn
import torch.nn.functional as F
from torchvision import datasets, transforms
import numpy as np
import higher
import gc
device = torch.device('cuda')
View network.py
import numpy as np
import tvm
from tvm import relay
from tvm.relay import op
from tvm.relay import create_executor, Module
from tvm.relay.backend.interpreter import TensorValue
from tvm.relay.prelude import Prelude
from tvm.relay.testing import add_nat_definitions
import aot
import collections
View check.py
def check_answer(answer):
def simulate(answer, r1, r2):
num_steps = 0
MAX_STEPS = 10000
commands = list(answer)
ptr1 = 0
ptr2 = 0
p1 = r1
p2 = r2
while num_steps < MAX_STEPS:
View logic.py
class LVal: # logical value. store fact we know about a logical variable
pass
class Unknown(LVal): # we dont know it's value
pass
class Known(LVal): # we know it's value
def __init__(self, x):
self.x = x
@MarisaKirisame
MarisaKirisame / Test.hs
Created Mar 25, 2017
typeclass problem
View Test.hs
{-# LANGUAGE TypeFamilies, UndecidableInstances #-}
import Data.Typeable
data Z = Z deriving (Typeable)
data S n = S n deriving (Typeable)
type family Plus l r
type instance Plus Z r = r
type instance Plus (S l) r = S (Plus l r)
type family Mult l r
You can’t perform that action at this time.