Skip to content

Instantly share code, notes, and snippets.

@wentropy
wentropy / yamlDemo.ipynb
Created October 16, 2021 16:58 — forked from tonyfast/yamlDemo.ipynb
Demonstration of YAML parsers in the Jupyter Notebook http://nbviewer.ipython.org/gist/tonyfast/e4bf0b6d77225faf1b04
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@wentropy
wentropy / timeseries_cnn.py
Created December 4, 2018 21:34 — 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
@wentropy
wentropy / live_loss_plot_keras.ipynb
Created December 4, 2018 20:27 — forked from stared/live_loss_plot_keras.ipynb
Live loss plot for training models in Keras (see: https://github.com/stared/livelossplot/ for a library)
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@wentropy
wentropy / FlatCnnLayer.py
Created November 26, 2018 12:04 — forked from paduvi/FlatCnnLayer.py
Hierarchical Softmax CNN Classification
import torch
import torch.nn as nn
import torch.nn.init as init
dropout_prob = 0.5
class FlatCnnLayer(nn.Module):
def __init__(self, embedding_size, sequence_length, filter_sizes=[3, 4, 5], out_channels=128):
super(FlatCnnLayer, self).__init__()
@wentropy
wentropy / akmtdfgen.py
Created December 20, 2017 23:42 — forked from timehaven/akmtdfgen.py
kmtdfgen: Keras multithreaded dataframe generator
"""akmtdfgen: A Keras multithreaded dataframe generator.
Works with Python 2.7 and Keras 2.x.
For Python 3.x, need to fiddle with the threadsafe generator code.
Test the generator_from_df() functions by running this file:
python akmtdfgen.py