> For the complete documentation index, see [llms.txt](https://ncxlib.gitbook.io/ncxlib/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://ncxlib.gitbook.io/ncxlib/getting-started/api-documentation/overview/neural-network.md).

# Neural Network

The NeuralNetwork class is the base model for a feed forward neural network.

Parameters:

* `layers`: A list of [`Layer`](/ncxlib/getting-started/api-documentation/overview/layer.md) objects.
* `loss_fn` (Optional) : A [`LossFunction`](/ncxlib/getting-started/api-documentation/overview/lossfunction.md) object. By default uses Mean Squared Error.

Returns:

```python
class NeuralNetwork:
    def __init__(self, layers: Optional[list[Layer]] = [], loss_fn: Optional[LossFunction] = MeanSquaredError):
        self.layers = layers
        self.compiled = False
        self.loss_fn = loss_fn
```
