Skip to content

Instantly share code, notes, and snippets.

View catdance124's full-sized avatar
🚪
Knock, and it will be opened to you.

kinosi catdance124

🚪
Knock, and it will be opened to you.
View GitHub Profile
import tensorflow as tf
class ConvLSTM(tf.keras.Model):
def __init__(self, dim_out):
super(ConvLSTM, self).__init__()
self.dim_out = dim_out
self.Wf = tf.keras.layers.Conv2D(dim_out, 5, 1, "same")
self.Wu = tf.keras.layers.Conv2D(dim_out, 5, 1, "same")
self.Wi = tf.keras.layers.Conv2D(dim_out, 5, 1, "same")
@koshian2
koshian2 / SGDR_Keras.py
Created August 28, 2018 15:14
Improve implementation of SGDR: Stochastic Gradient Descent with Warm Restarts in Keras
from keras.layers import Conv2D, Activation, BatchNormalization, Add, Input, GlobalAveragePooling2D, Dense
from keras.models import Model
from keras.optimizers import SGD
from keras.datasets import cifar10
from keras.utils import to_categorical
from keras.initializers import he_normal
from keras.preprocessing.image import ImageDataGenerator
from keras.callbacks import Callback, LearningRateScheduler
from keras.regularizers import l2
import numpy as np
@DylanModesitt
DylanModesitt / layers.py
Created March 8, 2018 14:28
Attentive LSTM keras
from keras import backend as K
from keras import regularizers, constraints, initializers, activations
from keras.layers.recurrent import RNN, Layer, _generate_dropout_mask, _generate_dropout_ones
from keras.engine import InputSpec
from keras.legacy import interfaces
import warnings
# Copied from original keras source
def _time_distributed_dense(x, w, b=None, dropout=None,
@jadarve
jadarve / readEXR.py
Last active February 18, 2024 16:16
Extract RGB and depth channels from exr images.
import numpy as np
import OpenEXR as exr
import Imath
def readEXR(filename):
"""Read color + depth data from EXR image file.
Parameters
----------
filename : str
@ypandit
ypandit / Xvfb.service
Last active September 8, 2023 13:13
Xvfb as a systemd service
[Unit]
Description=X Virtual Frame Buffer Service
After=network.target
[Service]
ExecStart=/usr/bin/Xvfb :99 -screen 0 1024x768x24
[Install]
WantedBy=multi-user.target