Skip to content

Instantly share code, notes, and snippets.

Avatar

Evan Compton ecompton3

View GitHub Profile
@ecompton3
ecompton3 / CoreMLViewController.swift
Last active Jun 21, 2017
A ViewController showing how to use a CoreML model in Swift
View CoreMLViewController.swift
//
// ViewController.swift
// coreTesting
//
// Created by Evan Compton on 6/12/17.
// Copyright © 2017 Evan Compton. All rights reserved.
//
import UIKit
import CoreML
@ecompton3
ecompton3 / keras_sentiment.py
Last active Jun 21, 2017
A very basic sentiment model using Keras converted to a CoreML model
View keras_sentiment.py
"""keras_sentiment.py
Very basic example showing how to create a coreML model from a Keras model
This model gives positive, 1, or negative, 0, sentiment based on a sentence
toeknized based on a predfined mapping. The amount of training data is too small to be useful
but the point of this script is to showcase the coreML tools abd very basic ML concepts.
This script is heavily based on the Keras IMDB example located here:
https://github.com/fchollet/keras/blob/master/examples/imdb_lstm.py
"""
View PromiseChainGenerator.js
'use strict'
let promiseChain = () => {
return new Promise(function(resolve, reject) {
resolve(1);
}).then((val) => {
return new Promise(function(resolve, reject) {