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 | |
import sys | |
import tensorflow as tf | |
import numpy as np | |
from tensorflow.examples.tutorials.mnist import input_data | |
class Model(object): | |
def __init__(self, x, with_new_layer=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
#!/usr/bin/env python | |
""" This example trains an LSTM to predict the next number | |
in a sequence 0, 0, 1, 1, 0, 0, 1, 1, ... | |
Training is done on very short sequences of length 3. | |
Loss is computed on all but the last predicted value for simplicity. | |
When REMEMBER_STATE is True, the previous LSTM state is transfered | |
to the next training step and the network reaches almost zero error. | |
When REMEMBER STATE is False, the network has no way to predict the |
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
#include <assert.h> | |
#include <algorithm> | |
#include <iostream> | |
#include <numeric> | |
#include <vector> | |
using namespace std; | |
bool next_perm(vector<int>& v) { |