Neural networks in continuous optical media