# Amusing thing I found in the Introduction to Flux

**URL:** <https://discourse.julialang.org/t/amusing-thing-i-found-in-the-introduction-to-flux/32589>\
**Category:** New to Julia\
**Created:** [December 22, 2019, 10:29pm UTC](https://discourse.julialang.org/t/amusing-thing-i-found-in-the-introduction-to-flux/32589 "2019-12-22T22:29:22Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![yuxi.liu](https://avatars.discourse-cdn.com/v4/letter/y/839c29/32.png) [@yuxi.liu](https://discourse.julialang.org/u/yuxi.liu)\
**Post date:** [December 22, 2019, 10:29pm UTC](https://discourse.julialang.org/t/amusing-thing-i-found-in-the-introduction-to-flux/32589/1 "2019-12-22T22:29:22Z")

</div>

Modified from Lecture 1’s file `1300.Intro-to-Flux.jl.ipynb`:

```julia
using CSV, DataFrames

apples = DataFrame(CSV.File(datapath("data/apples.dat"), delim='\t', normalizenames=true))
bananas = DataFrame(CSV.File(datapath("data/bananas.dat"), delim='\t', normalizenames=true));

x_apples = [[row.red, row.green] for row in eachrow(apples)]
x_bananas = [[row.red, row.green] for row in eachrow(bananas)];

xs = [x_apples; x_bananas] # vertical stacking of the features
ys = [fill(0, size(x_apples)); fill(1, size(x_bananas))]; # labels
xs

using Flux, Plots
model = Dense(2, 1, σ)
lossfun(feature, label) = Flux.mse(model(feature), label)
plot(lossfun.(xs, ys)) # Array of losses for each feature-label pair.

```

This results in the amusing plot that seems to have a very regular spiking interspersed in two rolling fields. Any idea why this is true?

 ![](https://global.discourse-cdn.com/julialang/original/3X/2/c/2cd1d0420053ea346a29855bd5777a888d435c50.png)
