Skip to content

Instantly share code, notes, and snippets.

View ecompton3's full-sized avatar

Evan Compton ecompton3

View GitHub Profile
@ecompton3
ecompton3 / CoreMLViewController.swift
Last active June 21, 2017 17:09
A ViewController showing how to use a CoreML model in 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 June 21, 2017 17:09
A very basic sentiment model using Keras converted to a CoreML model
"""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
"""
'use strict'
let promiseChain = () => {
return new Promise(function(resolve, reject) {
resolve(1);
}).then((val) => {
return new Promise(function(resolve, reject) {