Skip to content

Instantly share code, notes, and snippets.

View muety's full-sized avatar
🤓

Ferdinand Mütsch muety

🤓
View GitHub Profile
@muety
muety / simple_nn.go
Last active August 24, 2017 12:30
Simple Neural Network in Go
/* Simple neural net with one hidden layer consisting of one neuron */
/* Inspired by https://medium.com/technology-invention-and-more/how-to-build-a-simple-neural-network-in-9-lines-of-python-code-cc8f23647ca1 */
package main
import (
"fmt"
"math/rand"
"math"
)
@muety
muety / mlp.py
Created August 16, 2017 12:13
MNIST with Scikit Learn's Multi-Layer Perceptron
import numpy as np
from scipy.ndimage import convolve
from sklearn.neural_network import MLPClassifier
from sklearn.datasets import fetch_mldata
from sklearn.model_selection import train_test_split, cross_val_score, GridSearchCV
from sklearn.externals import joblib
import os.path
PATH = 'mlp_model.pkl'
@muety
muety / chan_example.go
Created May 16, 2017 19:07
Example for channels, inspired by vansimke's YouTube tutorial
// https://play.golang.org/p/Y8eaSkYNgG
package main
import (
"fmt"
)
const (
logDebug = "DEBUG"
@muety
muety / largest_prime_factor.go
Last active April 26, 2017 19:23
Delta Karlsruhe Gewinnspiel
package main
import (
"fmt"
"time"
)
func main() {
N := int64(751395478255)
n := N
@muety
muety / http_jsonrpc.go
Last active August 24, 2017 12:31
Go JSON-RPC over HTTP
package main
import (
"io"
"log"
"net"
"net/http"
"net/rpc"
"net/rpc/jsonrpc"
)
@muety
muety / fetch.js
Created March 6, 2017 09:36
Get image as base64 string using node-fetch
'use strict';
const fetch = require('node-fetch')
, base64stream = require('base64-stream');
const URL = 'https://www.google.de/images/branding/googlelogo/2x/googlelogo_color_272x92dp.png';
fetch(URL)
.then((res) => {
return new Promise((resolve, reject) => {

Keybase proof

I hereby claim:

  • I am n1try on github.
  • I am n1try (https://keybase.io/n1try) on keybase.
  • I have a public key ASBe0EvMz6BK5OOp5iOHy0vMXVGqtLq3ZMlJ2zNgOz6oBwo

To claim this, I am signing this object:

@muety
muety / berlin.json
Created January 16, 2017 20:46
Property Ranking dbr:Berlin
{
"http://dbpedia.org/property/description":0.025624229311943,
"http://dbpedia.org/ontology/elevation":0.912037393798431,
"http://dbpedia.org/ontology/PopulatedPlace/areaTotal":0.303861208756765,
"http://dbpedia.org/ontology/leaderParty":0.611218462189038,
"http://dbpedia.org/property/population":4.0748501565555735,
"http://dbpedia.org/ontology/demonym":0.23427369594574,
"http://dbpedia.org/property/leader":0.094248300542434,
"http://dbpedia.org/ontology/country":0.920875578125318,
"http://dbpedia.org/ontology/leaderTitle":0.540366853872935,
'use strict';
const fs = require('fs');
const FILE1 = './dbr_Karlsruhe_properties.txt';
const FILE2 = './KPProperties-DBpedia39-22.txt';
const CLUSTER = 1;
let properties = {};
let result = [];
'use strict';
const fs = require('fs');
const SEARCH_CLASS = 'http://yago-knowledge.org/resource/wikicat_Towns_in_Baden-Württemberg';
const FILE = './KPClasses-Yago2-22.txt';
let weights = [];
function func(line) {
if (line.indexOf(SEARCH_CLASS) === 0) {