Swish is a smooth activation function used to add nonlinearity to neural-network computations. Without an activation function, stacked linear layers collapse into a single linear model, limiting classification to linearly separable problems. In JAX, import it from jax.nn and apply it to each hidden layer's outputs. section 2.4.2
Using Swish in a forward pass
A prediction function computes each hidden layer with jnp.dot(w, activations) + b, then applies swish(outputs). The final layer produces logits without another shown activation. Calling predict(params, random_flattened_image) returns a ten-element output for the example image.

