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
##+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ | |
## Created by: Hang Zhang, Rutgers University, Email: zhang.hang@rutgers.edu | |
## Modified by Thomas Wolf, HuggingFace Inc., Email: thomas@huggingface.co | |
## Copyright (c) 2017-2018 | |
## | |
## This source code is licensed under the MIT-style license found in the | |
## LICENSE file in the root directory of this source tree | |
##+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ | |
"""Encoding Data Parallel""" |
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
import numpy as np | |
import pickle | |
""" | |
To use this RNN model do the following: | |
from rnn import RNN | |
model = RNN(word_dim, hidden_dim, truncte_back_prop_steps) | |
model.train(model, x_train, y_train, learning_rate, epochs, calculate_loss_after) | |
model.predict(x) | |
model.save_model(file_name) |
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
import numpy as np | |
import tensorflow as tf | |
from sklearn.manifold import TSNE | |
from sklearn import preprocessing | |
import matplotlib.pyplot as plt | |
corpus_raw = 'He is the king . The king is royal . She is the royal queen . The queen loves king' | |
# Convert the corpus to lower case | |
corpus_raw = corpus_raw.lower() |
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
package snladder; | |
import java.util.*; | |
public class Board { | |
// The board class defines the board | |
// We use Hash Maps for storing data about snakes and ladders. | |
private HashMap<Integer, Integer> board = new HashMap<>(); |