Skip to content

Instantly share code, notes, and snippets.

Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@FlorianMerkle
FlorianMerkle / min_callbacks_example.py
Created September 10, 2020 10:00
minimum example callbacks
import tensorflow as tf
(x_train, y_train), (x_test, y_test) = tf.keras.datasets.mnist.load_data()
x_train = (x_train.reshape(60000, 784).astype('float32') / 255)
x_test = (x_test.reshape(10000, 784).astype('float32') / 255)
def initialize_model():
model = tf.keras.Sequential()
model.add(tf.keras.layers.Dense(300))
@FlorianMerkle
FlorianMerkle / min_example.py
Last active May 19, 2020 10:14
Minimal Example - L0 Brendel Bethge
import tensorflow as tf
from tensorflow.keras import Model
from tensorflow.keras import layers
import foolbox as fb
(x_train, y_train), (x_test, y_test) = tf.keras.datasets.mnist.load_data()
x_train = (x_train.reshape(60000, 784).astype('float32') / 255)
x = tf.convert_to_tensor(tf.expand_dims(x_train[422].reshape(28,28,1), axis=0), tf.float32)*1
y = tf.convert_to_tensor([y_train[422]])*1
@FlorianMerkle
FlorianMerkle / speller.c
Created August 13, 2018 08:31
Implementation of a spell checker with mmap instead of malloc
// Implements a dictionary's functionality
#include <ctype.h>
#include <errno.h>
#include <fcntl.h>
#include <stdbool.h>
#include <stdint.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <strings.h>