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
class StaticMethod(object): | |
def __init__(self, func): | |
self.func = func | |
def __get__(self, obj, cls): | |
return self.func | |
def staticmethod(func): |
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 types | |
class ClassMethod(object): | |
def __init__(self, func): | |
self.__func__ = func | |
def __get__(self, obj, objtype=None): | |
return types.MethodType(self.__func__, objtype or type(obj), type) |
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 matplotlib.pyplot as plt | |
import numpy as np | |
import tensorflow as tf | |
from matplotlib.animation import FuncAnimation | |
from tensorflow.keras.layers import Conv2D, InputLayer, Layer | |
from tensorflow.keras.models import Sequential | |
size = 128 | |
n_frames = 240 | |
full_size = (1, size, size, 1) |