Skip to content

Instantly share code, notes, and snippets.

View doandongnguyen's full-sized avatar

Doan Dong Nguyen doandongnguyen

  • HUST
  • Vietnam
View GitHub Profile
@doandongnguyen
doandongnguyen / stock_price_autoencoding.ipynb
Created April 25, 2019 14:49 — forked from GerardBCN/stock_price_autoencoding.ipynb
Stock market Bitcoin data compression with autoencoders
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@doandongnguyen
doandongnguyen / timeseries_cnn.py
Created March 19, 2019 00:56 — forked from jkleint/timeseries_cnn.py
Example of using Keras to implement a 1D convolutional neural network (CNN) for timeseries prediction.
#!/usr/bin/env python
"""
Example of using Keras to implement a 1D convolutional neural network (CNN) for timeseries prediction.
"""
from __future__ import print_function, division
import numpy as np
from keras.layers import Convolution1D, Dense, MaxPooling1D, Flatten
from keras.models import Sequential
from rasa_nlu.featurizers import Featurizer
import tensorflow_hub as hub
import tensorflow as tf
class UniversalSentenceEncoderFeaturizer(Featurizer):
"""Appends a universal sentence encoding to the message's text_features."""
# URL of the TensorFlow Hub Module
@doandongnguyen
doandongnguyen / dropout_bayesian_approximation_tensorflow.py
Created December 3, 2018 19:16 — forked from VikingPenguinYT/dropout_bayesian_approximation_tensorflow.py
Implementing Dropout as a Bayesian Approximation in TensorFlow
import numpy as np
import tensorflow as tf
import matplotlib.pyplot as plt
from tensorflow.contrib.distributions import Bernoulli
class VariationalDense:
"""Variational Dense Layer Class"""
def __init__(self, n_in, n_out, model_prob, model_lam):
self.model_prob = model_prob