This file contains hidden or 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 java.io.File; | |
| import java.io.FileNotFoundException; | |
| import java.util.PriorityQueue; | |
| import java.util.Scanner; | |
| import java.util.TreeMap; | |
| /* Huffman coding , decoding */ | |
| public class Huffman { | |
| static final boolean readFromFile = false; |
This file contains hidden or 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 tensorflow as tf | |
| class testCell(tf.nn.rnn_cell.RNNCell): | |
| def __init__(self, input_size=1, state_size=1): | |
| self.input_size = input_size | |
| self._state_size = state_size | |
| @property | |
| def state_size(self): |
This file contains hidden or 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
| from keras import layers | |
| from keras import models | |
| import tensorflow as tf | |
| # | |
| # generator input params | |
| # | |
| rand_dim = (1, 1, 2048) # dimension of the generator's input tensor (gaussian noise) |
This file contains hidden or 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
| /** | |
| * Apache License 2.0 | |
| * see https://www.apache.org/licenses/LICENSE-2.0 | |
| */ | |
| import org.apache.commons.math3.distribution.EnumeratedDistribution; | |
| import org.apache.commons.math3.util.Pair; | |
| import org.nd4j.linalg.api.iter.NdIndexIterator; | |
| import org.nd4j.linalg.api.ndarray.INDArray; | |
| import org.nd4j.linalg.api.ops.impl.transforms.SetRange; | |
| import org.nd4j.linalg.api.ops.impl.transforms.SoftMax; |
This file contains hidden or 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
| from keras.layers import Dense, Dropout, LSTM, Embedding | |
| from keras.preprocessing.sequence import pad_sequences | |
| from keras.models import Sequential | |
| import pandas as pd | |
| import numpy as np | |
| input_file = 'input.csv' | |
| def load_data(test_split = 0.2): | |
| print ('Loading data...') |
This file contains hidden or 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
| from keras.layers import Dense, Dropout, LSTM, Embedding | |
| from keras.preprocessing.sequence import pad_sequences | |
| from keras.models import Sequential | |
| import pandas as pd | |
| import numpy as np | |
| input_file = 'input.csv' | |
| def load_data(test_split = 0.2): | |
| print ('Loading data...') |
This file contains hidden or 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
| from keras.layers import Dense, Dropout, LSTM, Embedding | |
| from keras.preprocessing.sequence import pad_sequences | |
| from keras.models import Sequential | |
| import pandas as pd | |
| import numpy as np | |
| input_file = 'input.csv' | |
| def load_data(test_split = 0.2): | |
| print ('Loading data...') |
This file contains hidden or 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
| from keras.layers import Dense, Dropout, LSTM, Embedding | |
| from keras.preprocessing.sequence import pad_sequences | |
| from keras.models import Sequential | |
| import pandas as pd | |
| import numpy as np | |
| input_file = 'input.csv' | |
| def load_data(test_split = 0.2): | |
| print ('Loading data...') |
This file contains hidden or 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) |
This file contains hidden or 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
| #!/usr/bin/env python | |
| # -*- coding: utf-8 -*- | |
| """ | |
| Denoising Autoencoders (dA) | |
| References : | |
| - P. Vincent, H. Larochelle, Y. Bengio, P.A. Manzagol: Extracting and | |
| Composing Robust Features with Denoising Autoencoders, ICML'08, 1096-1103, | |
| 2008 |