Skip to content

Instantly share code, notes, and snippets.

Frank A. Krueger praeclarum

Block or report user

Report or block praeclarum

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
@praeclarum
praeclarum / Dark Continuous.json
Created Mar 6, 2019
A dark and vibrant color theme for Visual Studio for Mac
View Dark Continuous.json
{
"name": "Dark Continuous",
"version": "1.0",
"description": "Dark and Vibrant from Continuous for the iPad",
"originator": "Frank A. Krueger",
"palette": [
{ "name": "cont-white", "value": "#F2F2F8" },
{ "name": "cont-selection", "value": "#4B5566" },
{ "name": "cont-background", "value": "#282A2E" },
@praeclarum
praeclarum / PlaidMLFailsDDPG.log
Created Jul 31, 2018
Error from PlaidML when running DDPG
View PlaidMLFailsDDPG.log
$ python ddpg_pendulum.py
/Users/fak/.virtualenvs/control/lib/python2.7/site-packages/gym/__init__.py:15: UserWarning: gym.undo_logger_setup is deprecated. gym no longer modifies the global logging configuration
warnings.warn("gym.undo_logger_setup is deprecated. gym no longer modifies the global logging configuration")
WARN: gym.spaces.Box autodetected dtype as <type 'numpy.float32'>. Please provide explicit dtype.
WARN: gym.spaces.Box autodetected dtype as <type 'numpy.float32'>. Please provide explicit dtype.
INFO:plaidml:Opening device "opencl_amd_amd_radeon_pro_vega_56_compute_engine.0"
_________________________________________________________________
Layer (type) Output Shape Param #
=================================================================
flatten_1 (Flatten) (None, 3) 0
@praeclarum
praeclarum / CSharpPredictor.fs
Created Jul 19, 2018
Predicts then next C# tokens given a history of previous tokens using CoreML on iOS with F#
View CSharpPredictor.fs
// Given previous tokens, predict the next token (and runners up)
let predictNextToken (previousKinds : SyntaxKind[]) : Prediction[] =
if ios11 then
let model : MLModel = model.Value // Load the cached model
let mutable predictions : Prediction[] = [| |]
// RNNs require external memory
let mutable lstm_1_h : MLMultiArray = null
let mutable lstm_1_c : MLMultiArray = null
@praeclarum
praeclarum / CSharpFormatter.fs
Created Apr 12, 2018
Formats C# code using roslyn syntax and semantics
View CSharpFormatter.fs
let getRefInfo (x : SyntaxNode) (ident : SyntaxToken) (isO : bool) =
let si = semantics.GetSymbolInfo (x)
if si.Symbol <> null then
Some (ident, si.Symbol, true, isO)
else None
let getDefInfo (x : SyntaxNode) (ident : SyntaxToken) (isO : bool) =
let s = semantics.GetDeclaredSymbol (x)
if s <> null then
Some (ident, s, false, isO)
View MacProPlaidMLPerf.md

iMac Pro PlaidML Training Perf

GPU vgg16 (batch size 8)

$ python plaidbench.py --train --batch-size 8 vgg16
/Users/fak/plaidml/lib/python2.7/site-packages/h5py/__init__.py:36: FutureWarning: Conversion of the second argument of issubdtype from `float` to `np.floating` is deprecated. In future, it will be treated as `np.float64 == np.dtype(float).type`.
  from ._conv import register_converters as _register_converters
Running 1024 examples with vgg16, batch size 8
Loading CIFAR data
@praeclarum
praeclarum / ListDiff.cs
Created Jun 15, 2017
Implements generic list diffing
View ListDiff.cs
using System;
using System.Collections.Generic;
namespace Praeclarum
{
/// <summary>
/// The type of <see cref="ListDiffAction{S,D}"/>.
/// </summary>
public enum ListDiffActionType
{
@praeclarum
praeclarum / ObservableQuery.cs
Last active May 7, 2019
This class is a new collection that is given a function to retrieve its own data. It uses ListDiff to minimize updates.
View ObservableQuery.cs
using System;
using System.Collections.Specialized;
using System.Collections;
using System.Collections.Generic;
using System.Threading;
using System.Linq;
using System.Diagnostics;
using System.Threading.Tasks;
namespace Praeclarum
@praeclarum
praeclarum / Matrix.fs
Created May 26, 2016
Basic matrix math in F#
View Matrix.fs
module Drone.Control.Matrix
open System
type Matrix =
| MZero of int * int
| MEye of int * float
| MArray of float[,]
| MTranspose of Matrix
| MDiagonal of float[]
@praeclarum
praeclarum / Ukf.fs
Created May 26, 2016
Unscented Kalman Filter (nonlinear version of the classic Kalman filter) in F#
View Ukf.fs
module Drone.Control.Ukf
open System
open Drone.Control.Matrix
type IDiscreteModel =
abstract Process : Matrix -> Matrix
abstract Observe : Matrix -> Matrix
abstract InitialState : Matrix
@praeclarum
praeclarum / Vibrantly Dark.json
Created Mar 4, 2016
A new dark theme for Xamarin Studio
View Vibrantly Dark.json
{
"name":"Vibrantly Dark",
"version":"1.0",
"description":"A dark theme with vibrant highlights. Inspired by One Dark Vibrant from Atom.",
"originator":"Frank A. Krueger (@praeclarum)",
"colors":[
{"name": "Background(Read Only)", "color":"#2A2A2A" },
{"name": "Search result background", "color":"#005F60" },
{"name": "Search result background (highlighted)", "color":"#007F80" },
{"name": "Fold Square", "color":"#63677F", "secondcolor":"#2A2A2A" },
You can’t perform that action at this time.