added docs page
This commit is contained in:
parent
8a0bd25d30
commit
08b95ec6a8
11
README.md
11
README.md
|
@ -38,13 +38,20 @@ To use lightning do 2 things:
|
||||||
- Automatic training loop
|
- Automatic training loop
|
||||||
```python
|
```python
|
||||||
# define what happens for training here
|
# define what happens for training here
|
||||||
def training_step(self, data_batch, batch_nb):
|
def training_step(self, data_batch, batch_nb):
|
||||||
|
x, y = data_batch
|
||||||
|
out = self.forward(x)
|
||||||
|
loss = my_loss(out, y)
|
||||||
|
return {'loss': loss}
|
||||||
```
|
```
|
||||||
- Automatic validation loop
|
- Automatic validation loop
|
||||||
|
|
||||||
```python
|
```python
|
||||||
# define what happens for validation here
|
# define what happens for validation here
|
||||||
def validation_step(self, data_batch, batch_nb):
|
def validation_step(self, data_batch, batch_nb): x, y = data_batch
|
||||||
|
out = self.forward(x)
|
||||||
|
loss = my_loss(out, y)
|
||||||
|
return {'loss': loss}
|
||||||
```
|
```
|
||||||
|
|
||||||
- Automatic early stopping
|
- Automatic early stopping
|
||||||
|
|
Loading…
Reference in New Issue