Skip to content

Instantly share code, notes, and snippets.

View rmaestre's full-sized avatar

Roberto Maestre rmaestre

View GitHub Profile
@rmaestre
rmaestre / residual_rnn_cell.py
Created May 15, 2017 09:07 — forked from yohokuno/residual_rnn_cell.py
Residual RNN cell for TensorFlow 0.10
import tensorflow as tf
from tensorflow.python.ops.rnn_cell import RNNCell
from tensorflow.python.ops import variable_scope as vs
from tensorflow.python.util import nest
class ResidualRNNCell(RNNCell):
"""RNN cell composed sequentially of multiple simple cells with residual connection."""
def __init__(self, cells, state_is_tuple=False):
/**
* bisecting <master> <input> <nNodes> <subIterations>
*
* divisive hierarchical clustering using bisecting k-means
* assumes input is a text file, each row is a data point
* given as numbers separated by spaces
*
*/
import org.apache.spark.SparkContext
from pyspark import SparkContext
import numpy as np
from sklearn.cross_validation import train_test_split, Bootstrap
from sklearn.datasets import make_classification
from sklearn.metrics import accuracy_score
from sklearn.tree import DecisionTreeClassifier
def run(sc):
/**
* bisecting <master> <input> <nNodes> <subIterations>
*
* divisive hierarchical clustering using bisecting k-means
* assumes input is a text file, each row is a data point
* given as numbers separated by spaces
*
*/
import org.apache.spark.SparkContext