Skip to content

Instantly share code, notes, and snippets.

View crockpotveggies's full-sized avatar
🥕
carrot

Justin Long crockpotveggies

🥕
carrot
View GitHub Profile
@crockpotveggies
crockpotveggies / docker-compose.kafka.yml
Created May 26, 2021 20:14
Run Kafka in one command using docker-compose
version: '2'
services:
zookeeper:
image: confluentinc/cp-zookeeper:latest
hostname: zookeeper
container_name: zookeeper
ports:
- '2181:2181'
environment:
ZOOKEEPER_CLIENT_PORT: '2181'
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@crockpotveggies
crockpotveggies / canada-provinces.json
Created March 16, 2020 21:37
GeoJSON of Canada's individual provinces
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@crockpotveggies
crockpotveggies / canada-healthregions.json
Last active April 7, 2020 06:04
GeoJSON of Canada's Health Regions and Authorities
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
import org.apache.commons.io.FileUtils;
import org.datavec.api.records.reader.SequenceRecordReader;
import org.datavec.api.records.reader.impl.csv.CSVSequenceRecordReader;
import org.datavec.api.split.NumberedFileInputSplit;
import org.deeplearning4j.api.storage.StatsStorage;
import org.deeplearning4j.arbiter.ComputationGraphSpace;
import org.deeplearning4j.arbiter.conf.updater.SgdSpace;
import org.deeplearning4j.arbiter.layers.LSTMLayerSpace;
import org.deeplearning4j.arbiter.layers.OutputLayerSpace;
import org.deeplearning4j.arbiter.optimize.api.OptimizationResult;
@crockpotveggies
crockpotveggies / sort-cifar.js
Last active December 14, 2018 07:43
NodeJS script to sort CIFAR-10 dataset of PNGs into label directories
var fs = require('fs')
var labels = fs.readFileSync('labels.txt', 'utf-8')
.split('\n')
.filter(Boolean);
/*for(i = 0; i < labels.length; i++) {
fs.mkdirSync("./train/"+i);
fs.mkdirSync("./test/"+i);
}*/
@crockpotveggies
crockpotveggies / install-apache-maven-3.3.9.sh
Created April 12, 2018 01:33 — forked from miroslavtamas/install-apache-maven-3.3.9.sh
Install Apache Maven 3.3.9 on CentOS
#!/bin/sh
wget http://www.eu.apache.org/dist/maven/maven-3/3.3.9/binaries/apache-maven-3.3.9-bin.tar.gz
tar xzf apache-maven-3.3.9-bin.tar.gz
sudo mkdir /usr/local/maven
sudo mv apache-maven-3.3.9/ /usr/local/maven/
sudo alternatives --install /usr/bin/mvn mvn /usr/local/maven/apache-maven-3.3.9/bin/mvn 1
sudo alternatives --config mvn
@crockpotveggies
crockpotveggies / gist:a061311b88cf21d3e662f7834f3a9b03
Last active October 27, 2017 00:35
Sequence to Sequence Autoencoder Preprocessor
object Preprocessor extends Serializable {
class Seq2SeqAutoencoderPreProcessor extends MultiDataSetPreProcessor {
override def preProcess(mds: MultiDataSet): Unit = {
val input: INDArray = mds.getFeatures(0)
val features: Array[INDArray] = Array.ofDim[INDArray](2)
val labels: Array[INDArray] = Array.ofDim[INDArray](1)
features(0) = input
// note the column names don't exactly match, we are arbitrarily assigning them
val schema = new Schema.Builder()
.addColumnsString("Timestamp")
.addColumnCategorical("VesselType")
.addColumnsString("MMSI")
.addColumnsString("Lat","Lon") // will convert to Double later
.addColumnCategorical("Status")
.addColumnsDouble("ROT","SOG","COG")
.addColumnInteger("Heading")
.addColumnsString("IMO","Callsign","Name")