Skip to content

Instantly share code, notes, and snippets.

View HTLife's full-sized avatar

JackyLiu HTLife

  • National Chung Cheng University
  • Tokyo, Japan
View GitHub Profile
@HTLife
HTLife / cnn_lstm.py
Last active April 8, 2021 05:00
Time distributed CNNs + LSTM in Keras
def defModel():
model = Sequential()
#Izda.add(TimeDistributed(
# Convolution2D(40,3,3,border_mode='same'), input_shape=(sequence_lengths, 1,8,10)))
model.add(
TimeDistributed(
Conv2D(32, (7, 7), padding='same', strides = 2),
input_shape=(None, 540, 960, 2)))
model.add(Activation('relu'))
@HTLife
HTLife / summary.py
Created March 16, 2018 06:37
Pytorch model summary
def summary(input_size, model):
def register_hook(module):
def hook(module, input, output):
class_name = str(module.__class__).split('.')[-1].split("'")[0]
module_idx = len(summary)
m_key = '%s-%i' % (class_name, module_idx+1)
summary[m_key] = OrderedDict()
summary[m_key]['input_shape'] = list(input[0].size())
summary[m_key]['input_shape'][0] = -1
@HTLife
HTLife / 樣式(適用所有卡片)
Created February 26, 2018 04:03
Anki card template
.frontbg {
background-color: #53cd80;
border-radius: 7px;
color: #fff;
position: relative;
left: 0;
}
.android .frontbg {
background-color: #eelf34;
border-radius: 7px;
@HTLife
HTLife / CNNLSTM.ipynb
Last active September 24, 2019 15:42
DeepVO like neural network structure example
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
import numpy as np
import os
import tensorflow as tf
#import urllib2
#from datasets import imagenet
#from nets import inception
#from preprocessing import inception_preprocessing
from PIL import Image, ImageDraw, ImageFont