Skip to content

Instantly share code, notes, and snippets.

@endolith
endolith / DFT_ANN.py
Last active January 6, 2025 15:05
Training neural network to implement discrete Fourier transform (DFT/FFT)
"""
Train a neural network to implement the discrete Fourier transform
"""
import matplotlib.pyplot as plt
import numpy as np
from tensorflow.keras.layers import Dense
from tensorflow.keras.models import Sequential
N = 32
batch = 10000