Skip to content

Instantly share code, notes, and snippets.

View ecompton3's full-sized avatar

Evan Compton ecompton3

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