Skip to content

Instantly share code, notes, and snippets.

View schaelle's full-sized avatar

Stefan Schälle schaelle

  • Raiffeisen Schweiz
  • Switzerland
View GitHub Profile
@schaelle
schaelle / Inference.java
Created January 27, 2021 00:55 — forked from steven-mi/Inference.java
Running a SavedModel in Java
package org.example;
import org.tensorflow.SavedModelBundle;
import org.tensorflow.Tensor;
import org.tensorflow.ndarray.IntNdArray;
import org.tensorflow.ndarray.NdArrays;
import org.tensorflow.ndarray.Shape;
import org.tensorflow.proto.framework.SignatureDef;
import org.tensorflow.types.TInt32;
@schaelle
schaelle / understanding-word-vectors.ipynb
Created March 3, 2018 17:17 — forked from aparrish/understanding-word-vectors.ipynb
Understanding word vectors: A tutorial for "Reading and Writing Electronic Text," a class I teach at ITP. (Python 2.7) Code examples released under CC0 https://creativecommons.org/choose/zero/, other text released under CC BY 4.0 https://creativecommons.org/licenses/by/4.0/
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
#!/usr/bin/env python
import paho.mqtt.client as mqtt
import RPi.GPIO as GPIO
def on_connect(client, userdata, rc):
#print ("Connected with rc: " + str(rc))
client.subscribe("kwf/demo/led")
def on_message(client, userdata, msg):
@schaelle
schaelle / SubsetSum.cs
Created April 20, 2017 13:35 — forked from riyadparvez/SubsetSum.cs
Implementation of subset sum problem using dynamic programming approach in C#.
public static bool SubsetSum(IEnumerable<int> list, int s)
{
var arr = list.ToArray();
Array.Sort(arr);
var a = arr.Where(i => i < 0).Sum();
var b = arr.Where(i => i > 0).Sum();
if(a > s || b < s)
{
return false;
}