Skip to content

Instantly share code, notes, and snippets.

View hageldave's full-sized avatar

David Hägele hageldave

  • University of Stuttgart
  • Germany / Stuttgart
View GitHub Profile
# Autoencoder example for dimensionalilty reduction of MNIST
# Requires tensorflow and seaborn
# e.g.: pip install tensorflow-cpu seaborn
import tensorflow as tf
import numpy as np
import seaborn as sns
import matplotlib.pyplot as plt
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@hageldave
hageldave / BarycentricGradientPaint.java
Last active January 3, 2022 14:57
A java.awt.Paint implementation for triangular color interpolation (using barycentric coordinates). The svg file shows the result of the demo app (embedded image).
/* Copyright 2021 David Haegele - Source from JPlotter */
import java.awt.Color;
import java.awt.Paint;
import java.awt.PaintContext;
import java.awt.Rectangle;
import java.awt.RenderingHints;
import java.awt.Shape;
import java.awt.geom.AffineTransform;
import java.awt.geom.Point2D;
@hageldave
hageldave / isolines.svg
Created June 25, 2019 13:23
svg export of JPlotter's isoline demo
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@hageldave
hageldave / barycentric.svg
Last active December 29, 2021 18:40
svg triangle barycentric color interpolation
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
import static org.apache.batik.anim.dom.SVGDOMImplementation.SVG_NAMESPACE_URI;
import java.io.ByteArrayInputStream;
import java.io.ByteArrayOutputStream;
import java.io.IOException;
import java.io.OutputStreamWriter;
import java.util.Scanner;
import org.apache.batik.anim.dom.SVGDOMImplementation;
import org.apache.batik.transcoder.TranscoderException;
@hageldave
hageldave / DrawOnDemand.java
Last active June 2, 2019 16:27
AWTGLCanvas draw on demand
import java.awt.Dimension;
import java.awt.Graphics;
import java.awt.event.ComponentAdapter;
import javax.swing.JFrame;
import javax.swing.SwingUtilities;
import org.lwjgl.opengl.GL;
import org.lwjgl.opengl.GL11;
import org.lwjgl.opengl.awt.AWTGLCanvas;
@hageldave
hageldave / vis01.m
Last active April 11, 2019 18:41
visualizing linear inequality constraints in 2D optimization problem
clear all;
clc;
more off;
function result = normalize(x)
l = norm(x);
if l > 0.00001
result = x/l;
else
result = x;
@hageldave
hageldave / RadonTransform.java
Last active March 22, 2019 00:39
RGB Radon Transform of Images
package radon;
import java.util.function.DoubleBinaryOperator;
import hageldave.imagingkit.core.Img;
import hageldave.imagingkit.core.io.ImageLoader;
import hageldave.imagingkit.core.io.ImageSaver;
import hageldave.imagingkit.core.scientific.ColorImg;
import hageldave.imagingkit.core.util.ImageFrame;