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 python3 | |
| # -*- coding: utf-8 -*- | |
| """ | |
| Created on Thu Apr 11 00:02:58 2019 | |
| @author: spandan | |
| """ | |
| # Please only modify the indicated area below! |
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 <vector> | |
| template<typename Out> | |
| void split(std::string& s, char delim, Out result) { | |
| std::stringstream ss(s); | |
| std::string item; | |
| while (std::getline(ss, item, delim)) { | |
| *(result++) = item; |
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 <vector> | |
| #include <numeric> | |
| #include <fstream> | |
| #include <iterator> | |
| #include <algorithm> | |
| template<typename T> | |
| class FindPeaks{ | |
| private: | |
| std::vector<T> m_input_signal; // stores input vector |
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
| 13 | |
| 0,1 | |
| 0,6 | |
| 0,5 | |
| 2,0 | |
| 2,3 | |
| 5,4 | |
| 6,4 | |
| 6,9 | |
| 7,6 |
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 __future__ import print_function | |
| import os | |
| import _pickle as pickle | |
| import numpy as np | |
| import keras | |
| from keras.datasets import cifar10 | |
| from keras.preprocessing.image import ImageDataGenerator | |
| from keras.models import Sequential, load_model |
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
| # try running cpu intensive test on two devices | |
| import tensorflow as tf | |
| import time | |
| def matmul_op(): | |
| """Multiply two matrices together""" | |
| n = 2000 | |
| a = tf.ones((n, n), dtype=tf.float32) |
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
| #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 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
| '''This script goes along the blog post | |
| "Building powerful image classification models using very little data" | |
| from blog.keras.io. | |
| It uses data that can be downloaded at: | |
| https://www.kaggle.com/c/dogs-vs-cats/data | |
| In our setup, we: | |
| - created a data/ folder | |
| - created train/ and validation/ subfolders inside data/ | |
| - created cats/ and dogs/ subfolders inside train/ and validation/ | |
| - put the cat pictures index 0-999 in data/train/cats |
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
| def convex_hull_graham(points): | |
| ''' | |
| Returns points on convex hull in CCW order according to Graham's scan algorithm. | |
| By Tom Switzer <thomas.switzer@gmail.com>. | |
| ''' | |
| TURN_LEFT, TURN_RIGHT, TURN_NONE = (1, -1, 0) | |
| def cmp(a, b): | |
| return (a > b) - (a < b) |
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.util.Iterator; | |
| import java.util.NoSuchElementException; | |
| // Introduction: | |
| // | |
| // This is an example class meant to illustrate several differen concepts: | |
| // * The use of type parameters (i.e. Java generics) | |
| // * Implementing an iterator over some collection, in this case an array | |
| // * Implementing the Iterable interface, which enables your collection | |
| // to work with the Java simple for loops, i.e. (for String s : list) |
NewerOlder