%%init_spark
# Configure the location of the mesos master and spark distribution on HDFS
# launcher.jars = ["/some/local/path/to/a/file.jar"]
launcher.packages = ["org.elasticsearch:elasticsearch-hadoop:6.6.0",
"org.apache.hadoop:hadoop-aws:2.7.5",
"org.apache.hadoop:hadoop-common:2.7.5",
"com.amazonaws:aws-java-sdk:1.7.4"]
launcher.master = "k8s://kubernetes.default"
launcher.conf.set("spark.submit.deployMode", "client")
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
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
class NeuMF(torch.nn.Module): | |
def __init__(self, config): | |
super(NeuMF, self).__init__() | |
#mf part | |
self.embedding_user_mf = torch.nn.Embedding(num_embeddings=self.num_users, embedding_dim=self.latent_dim_mf) | |
self.embedding_item_mf = torch.nn.Embedding(num_embeddings=self.num_items, embedding_dim=self.latent_dim_mf) | |
#mlp part | |
self.embedding_user_mlp = torch.nn.Embedding(num_embeddings=self.num_users, embedding_dim=self.latent_dim_mlp) |
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
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
# Keras==1.0.6 | |
from keras.models import Sequential | |
import numpy as np | |
from keras.layers.recurrent import LSTM | |
from keras.layers.core import TimeDistributedDense, Activation | |
from keras.preprocessing.sequence import pad_sequences | |
from keras.layers.embeddings import Embedding | |
from sklearn.cross_validation import train_test_split | |
from keras.layers import Merge | |
from keras.backend import tf |
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
#Source code with the blog post at http://monik.in/a-noobs-guide-to-implementing-rnn-lstm-using-tensorflow/ | |
import numpy as np | |
import random | |
from random import shuffle | |
import tensorflow as tf | |
# from tensorflow.models.rnn import rnn_cell | |
# from tensorflow.models.rnn import rnn | |
NUM_EXAMPLES = 10000 |
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
class CategoriesController < ApplicationController | |
include Behaveable::ResourceFinder | |
include Behaveable::RouteExtractor | |
# Response type. | |
respond_to :json | |
# Get categories. | |
# | |
# GET (/:categorizable/:categorizable_id)/categories(.:format) |
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 character-level Vanilla RNN model. Written by Andrej Karpathy (@karpathy) | |
BSD License | |
""" | |
import numpy as np | |
# data I/O | |
data = open('input.txt', 'r').read() # should be simple plain text file | |
chars = list(set(data)) | |
data_size, vocab_size = len(data), len(chars) |
NewerOlder