I place my learning process in this document with 2 motives:
- To have a quick guide whenever I lost the track of knowledge.
- To share the knowledge with anyone wants to learn RESTful APIs
| from keras.layers import Recurrent | |
| import keras.backend as K | |
| from keras import activations | |
| from keras import initializers | |
| from keras import regularizers | |
| from keras import constraints | |
| from keras.engine import Layer | |
| from keras.engine import InputSpec |
| """ | |
| Beam decoder for tensorflow | |
| Sample usage: | |
| ``` | |
| from tf_beam_decoder import beam_decoder | |
| decoded_sparse, decoded_logprobs = beam_decoder( | |
| cell=cell, |
| """ | |
| backtracking extended list informed | |
| Depth First Search: y y n | |
| Breadth First Search: n y n | |
| Hill Climbing y y y | |
| Beam Search: y y y | |
| """ | |
| import heapq |
| # variation to https://github.com/ryankiros/skip-thoughts/blob/master/decoding/search.py | |
| def keras_rnn_predict(samples, empty=empty, rnn_model=model, maxlen=maxlen): | |
| """for every sample, calculate probability for every possible label | |
| you need to supply your RNN model and maxlen - the length of sequences it can handle | |
| """ | |
| data = sequence.pad_sequences(samples, maxlen=maxlen, value=empty) | |
| return rnn_model.predict(data, verbose=0) | |
| def beamsearch(predict=keras_rnn_predict, |
| #!/bin/sh | |
| # size of swapfile in megabytes | |
| swapsize=4000 | |
| # does the swap file already exist? | |
| grep -q "swapfile" /etc/fstab | |
| # if not then create it | |
| if [ $? -ne 0 ]; then |
| Prerequisites: | |
| ============== | |
| 1. Raspbian | |
| 2. Raspberry Pi (2) | |
| sudo apt-get update | |
| sudo apt-get upgrade | |
| cd | |
| ## Source: http://node-arm.herokuapp.com/ |
| #!/bin/bash | |
| DIR='/dev/disk/by-id/' | |
| #DIR='/dev/disk/by-vdev/' | |
| #DIR='/dev/disk/by-path/' | |
| PREFIX='ata-*' | |
| #PREFIX='pci-*' | |
| #PREFIX='*' |
| module.exports = function (grunt) { | |
| "use strict"; | |
| var neat = require('node-neat').includePaths; | |
| // Config... | |
| grunt.initConfig({ | |
| pkg: grunt.file.readJSON('package.json'), | |
| connect: { | |
| server: { | |
| options: { | |
| port: 9001, |
| #!/bin/bash | |
| # Description: Using Docker (requires docker to be installed http://www.docker.io/gettingstarted/ ), spawn a postgresql instance and a dynamically configured treeio instance | |
| # Also requires postgresql client tools http://www.postgresql.org/download/linux/ubuntu/ | |
| # Run chmod +x to make this file executable then run it: ./docker_create_treeio.sh | |
| # Author: Adam Awan | |
| # Email: [email protected] | |
| # Set the port to forward for Tree.io | |
| TREEIO_PORT="80" |