Skip to content

Instantly share code, notes, and snippets.

@olix20
olix20 / speaker_embedding_triplet_loss.py
Last active April 4, 2019 23:17
outline of the model to train/extract speaker embeddings
def identity_loss(y_true, y_pred):
return K.mean(y_pred - 0 * y_true)
def triplet_loss(X):
positive_item_latent, negative_item_latent, user_latent = X
loss = 1.0 - K.sigmoid(
K.sum(user_latent * positive_item_latent, axis=-1, keepdims=True) -
K.sum(user_latent * negative_item_latent, axis=-1, keepdims=True))
@olix20
olix20 / 2d_CRNN.py
Last active April 4, 2019 23:18
combination of 2d cnn with lstm for keyword detection
def get_CRNN_layers( x_in ):
#timestamps = 32
#freq_dim = 256
x = BatchNormalization()(x_in)
x = Reshape((timesteps, freq_dim,1))(x)
@olix20
olix20 / vgg_like_1dconvs_frequency.py
Created April 19, 2018 15:22
sample vgg like 1dconvs on freque
def get_1dconvs_maxpool_freq_deep( x_in, kernel_size=2):
p=0.0
x = BatchNormalization()(x_in)
x = Conv1D(64,kernel_size,padding='same')(x)
x = batch_relu(x)
x = Conv1D(64,kernel_size,padding='same')(x)
x = batch_relu(x)
8.437661] #60cpu 60 spinlock event irq 413
[ 8.443513] installing Xen timer for CPU 61
[ 8.445787] #61cpu 61 spinlock event irq 419
[ 8.451558] installing Xen timer for CPU 62
[ 8.453816] #62cpu 62 spinlock event irq 425
[ 8.459623] installing Xen timer for CPU 63
[ 8.461831] #63cpu 63 spinlock event irq 431
[ 8.467649] x86: Booted up 2 nodes, 64 CPUs
[ 8.469775] smpboot: Total of 64 processors activated (296351.48 BogoMIPS)
[ 8.476427] devtmpfs: initialized
15482760
[ 0.000000] Policy zone: Normal
[ 0.000000] Kernel command line: BOOT_IMAGE=/boot/vmlinuz-4.4.0-59-generic root=UUID=b227be2c-6837-465f-83ac-42956a89ad4c ro console=tty1 console=ttyS0
[ 0.000000] log_buf_len individual max cpu contribution: 4096 bytes
[ 0.000000] log_buf_len total cpu_extra contributions: 520192 bytes
[ 0.000000] log_buf_len min size: 262144 bytes
[ 0.000000] log_buf_len: 1048576 bytes
[ 0.000000] early log buf free: 249696(95%)
[ 0.000000] PID hash table entries: 4096 (order: 3, 32768 bytes)
@olix20
olix20 / README.md
Last active April 4, 2019 23:18
Flight analysis

##Summary

This chart shows the average arrival delays for US domestic flights in 2014. We can see how the delay pattern develops through out the year, and how different types of delay contribute to the toal delay.We see a consistent pattern that the least chance of a delay is when you travel in April or September. The peaks are June-August and December-January.

##Design

I'm interested to see how the average delay varies over months. I expect line chart to best represent this: x-axis will show months of year and y-axis will show the mean delay. Since we want to know how each individual delay type evolves (weather, security, etc.), there will be one line chart per individual delay type. All lines would share the same primary light blue color, except for total delay which is in black. This is to avoid distraction and differentiate between total and other delay types.

We can see a general pattern where peak delays happen in summer/winter holidays. There may be also a compounding relationship between differe