Skip to content

Instantly share code, notes, and snippets.

View jshayiding's full-sized avatar

Jurat jshayiding

View GitHub Profile
## approach-1
#--------------------------------------------------------------------#
def taylor_func(x, func_type='sin(x)', n_terms=2):
# f(a) + 0.5 * f`(a)(x - a) + f``(a)(x - a)^2
if func_type == 'sin(x)':
c = tf.constant([1, -1/6, 1/120, -1/5040], dtype=tf.float32)
p = tf.constant([1,3,5,7], dtype=tf.float32)
import tensorflow as tf
from tensorflow.keras.models import Sequential
from tensorflow.keras.layers import Dense, Dropout, Activation
from tensorflow.keras.utils import to_categorical
from tensorflow.keras.preprocessing.image import ImageDataGenerator
from tensorflow.keras.layers import Conv2D, MaxPooling2D, ZeroPadding2D, GlobalAveragePooling2D, Flatten
from tensorflow.keras.layers import BatchNormalization
from tensorflow.keras.models import Model
from tensorflow.keras import regularizers
from tensorflow.keras.datasets import cifar10
@jshayiding
jshayiding / miniTest.R
Last active January 25, 2017 16:24
minimal peak Interval example
# minimal example to test revised implementation
grs <- GRangesList(
bar= GRanges(seqnames = Rle("chr1",9),
IRanges(
c(8,18,33,53,69,81,105,115,135),
c(14,21,39,61,73,87,111,120,153)),
score=c(48,7,10,8,4,15,4,4,38)),
cat = GRanges(seqnames = Rle("chr1",8),
IRanges(