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
## 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) |
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 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 |
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
# 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( |