Skip to content

Instantly share code, notes, and snippets.

@FedeMiorelli
FedeMiorelli / turbo_colormap_mpl.py
Last active March 31, 2023 02:45
Turbo Colormap for Matplotlib
# -*- coding: utf-8 -*-
"""
Created on 2019-08-22 09:37:36
@author: fmiorell
"""
# This script registers the "turbo" colormap to matplotlib, and the reversed version as "turbo_r"
# Reference: https://ai.googleblog.com/2019/08/turbo-improved-rainbow-colormap-for.html
@endolith
endolith / DFT_ANN.py
Last active April 29, 2024 11:20
Training neural network to implement discrete Fourier transform (DFT/FFT)
"""
Train a neural network to implement the discrete Fourier transform
"""
from tensorflow.keras.models import Sequential
from tensorflow.keras.layers import Dense
import numpy as np
import matplotlib.pyplot as plt
N = 32
batch = 10000