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 sys | |
import inspect | |
import json | |
''' | |
Functions for clients to call to serialise/unserialise from strings and files | |
Idea taken from http://getpython3.com/diveintopython3/serializing.html | |
and generalised to allow helper functions to be part of the custom classes | |
and avoid case statements |
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 com.davesnowdon.meetup; | |
import org.apache.commons.io.FileUtils; | |
import org.apache.commons.lang3.ArrayUtils; | |
import org.apache.commons.lang3.StringUtils; | |
import org.datavec.api.util.ClassPathResource; | |
import org.deeplearning4j.api.storage.StatsStorage; | |
import org.deeplearning4j.nn.conf.MultiLayerConfiguration; | |
import org.deeplearning4j.nn.conf.NeuralNetConfiguration; | |
import org.deeplearning4j.nn.conf.layers.EmbeddingLayer; |
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
/* | |
* Model | |
*/ | |
private MultiLayerNetwork createModel(int vocabSize, int embeddingSize, int rnnSize) { | |
MultiLayerConfiguration conf = new NeuralNetConfiguration.Builder() | |
.activation(Activation.RELU) | |
.learningRate(0.01) | |
.list() | |
.layer(0, new EmbeddingLayer.Builder().nIn(vocabSize).nOut(300).build()) | |
.layer(1, new GravesLSTM.Builder().nIn(300).nOut(512).activation(Activation.SOFTSIGN).build()) |
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
def get_inputs(): | |
""" | |
Create TF Placeholders for input, targets, and learning rate. | |
""" | |
# TODO: Implement Function | |
return tf.placeholder(tf.int32, shape=(None, None), name="input"), tf.placeholder(tf.int32, shape=(None, None)), tf.placeholder(tf.float32) | |
def get_init_cell(batch_size, rnn_size): | |
""" |
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
from imutils import paths | |
import argparse | |
import requests | |
import cv2 | |
import os | |
import numpy as np | |
# Adapted from https://www.pyimagesearch.com/2017/12/04/how-to-create-a-deep-learning-dataset-using-google-images/ | |
# fixes the following issues with the original: | |
# 1 - files are always saved as .jpg even if they are not in JPEG format |
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
Wed 8 Aug 06:33:54 BST 2018 pkg-config-wrapper.sh --exists | |
--print-errors --short-errors harfbuzz | |
PKG_CONFIG_DIR= | |
PKG_CONFIG_LIBDIR=:/opt/software/raspberrypi/rpi-cross/rootfs/usr/lib/arm-linux-gnueabihf/pkgconfig:/opt/software/raspberrypi/rpi-cross/rootfs/usr/share/pkgconfig:/opt/software/raspberrypi/rpi-cross/rootfs/opt/vc/lib/pkgconfig | |
PKG_CONFIG_SYSROOT_DIR=/opt/software/raspberrypi/rpi-cross/rootfs | |
pkg-config = | |
Wed 8 Aug 06:33:54 BST 2018 pkg-config-wrapper.sh --modversion | |
harfbuzz | |
PKG_CONFIG_DIR= | |
PKG_CONFIG_LIBDIR=:/opt/software/raspberrypi/rpi-cross/rootfs/usr/lib/arm-linux-gnueabihf/pkgconfig:/opt/software/raspberrypi/rpi-cross/rootfs/usr/share/pkgconfig:/opt/software/raspberrypi/rpi-cross/rootfs/opt/vc/lib/pkgconfig |
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
-- The CXX compiler identification is GNU 6.3.0 | |
-- The C compiler identification is GNU 6.3.0 | |
-- Check for working CXX compiler: /opt/cross/x-tools/arm-unknown-linux-gnueabihf/bin/arm-unknown-linux-gnueabihf-g++ | |
-- Check for working CXX compiler: /opt/cross/x-tools/arm-unknown-linux-gnueabihf/bin/arm-unknown-linux-gnueabihf-g++ -- works | |
-- Detecting CXX compiler ABI info | |
-- Detecting CXX compiler ABI info - done | |
-- Detecting CXX compile features | |
-- Detecting CXX compile features - done | |
-- Check for working C compiler: /opt/cross/x-tools/arm-unknown-linux-gnueabihf/bin/arm-unknown-linux-gnueabihf-gcc | |
-- Check for working C compiler: /opt/cross/x-tools/arm-unknown-linux-gnueabihf/bin/arm-unknown-linux-gnueabihf-gcc -- works |
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
service TheSocialRobot { | |
rpc EventStream(stream BodyEvent) returns (stream BodyCommand) {} | |
} |
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
// event from robot (the body) containing current state | |
message BodyEvent { | |
int32 id = 1; | |
} |
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
message Say { | |
string text = 1; | |
} | |
message Action { | |
// delay in milliseconds before triggering the action | |
int32 delay = 1; | |
oneof action { | |
Say say = 2; | |
} |
OlderNewer