Skip to content

Commit d76600d

Browse files
Apply suggestions from code review
Co-authored-by: Sabine Ståhlberg <[email protected]>
1 parent 0845b67 commit d76600d

File tree

2 files changed

+22
-23
lines changed

2 files changed

+22
-23
lines changed

CHANGELOG.md

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,15 @@
11
## neptune-pytorch 3.0.0
22

3-
### Breaking Changes
4-
- **Neptune 3.x only**: This version only supports Neptune 3.x and requires a Neptune 3.x API Key.
3+
### Changes
4+
- **Neptune 3.x only**: This version only supports Neptune 3.x and requires a Neptune 3.x API token.
55
- **Dropped support for logging model binaries and checkpoints**: The `log_model()` and `log_checkpoint()` methods have been removed.
66
- **Removed gradient and parameter tracking flags from NeptuneLogger constructor**: The `log_gradients`, `log_parameters`, and `log_freq` parameters have been removed from the NeptuneLogger constructor. Use `log_model_internals()` parameters instead.
77
- **Updated namespace structure**: Model internals are now logged under `{base_namespace}/model/internals/{prefix}/{metric_type}/{layer}/{statistic}`. For example, `pytorch_experiment/model/internals/train/activations/conv1/mean`.
88
- **Changed base_namespace default**: The `base_namespace` parameter now defaults to `None` instead of `"training"`.
9-
- **Dropped support for Python <=3.9**
9+
- Dropped support for Python `<=3.9`
1010
-
11-
### New Features
12-
- **Enhanced model monitoring**: Added comprehensive model internals tracking with configurable statistics (mean, std, norm, min, max, var, abs_mean, hist).
11+
### Features
12+
- **Enhanced model monitoring**: Added comprehensive model internals tracking with configurable statistics: mean, std, norm, min, max, var, abs_mean, hist.
1313
- **Flexible layer filtering**: Added `track_layers` parameter to specify which layer types to track.
1414
- **Configurable statistics**: Added `tensor_stats` parameter to customize which statistics to compute for tracked tensors.
1515

README.md

Lines changed: 17 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -24,9 +24,15 @@ pip install -U neptune-pytorch
2424
- **PyTorch 1.11+**: For tensor operations and model support
2525
- **NumPy 1.20+**: For numerical computations
2626

27-
## Quick Start
27+
## Quickstart
2828

29-
### Basic usage
29+
The below quickstart example logs the following data to Neptune:
30+
31+
- **Model architecture**: Visual diagram and summary of the neural network
32+
- **Training metrics**: Loss curves and epoch progress
33+
- **Layer activations**: Mean, std, norm, histograms for each layer
34+
- **Gradient analysis**: Gradient statistics to detect vanishing/exploding gradients
35+
- **Parameter tracking**: Weight and bias distributions over time
3036

3137
```python
3238
import torch
@@ -86,15 +92,14 @@ for epoch in range(num_epochs):
8692
)
8793
```
8894

89-
**Logged data in Neptune:**
95+
## Advanced configuration
9096

91-
- **Model architecture**: Visual diagram and summary of the neural network
92-
- **Training metrics**: Loss curves and epoch progress
93-
- **Layer activations**: Mean, std, norm, histograms for each layer
94-
- **Gradient analysis**: Gradient statistics to detect vanishing/exploding gradients
95-
- **Parameter tracking**: Weight and bias distributions over time
97+
The below example demonstrates the following additional features:
9698

97-
### Advanced configuration
99+
- **Layer filtering**: Only track Conv2d and Linear layers (reduces overhead)
100+
- **Custom statistics**: Use mean, std, hist instead of all 8 statistics
101+
- **Phase-specific tracking**: Different tracking strategies for train/validation
102+
- **Frequency control**: Track every 20 steps in training, every 50 in validation
98103

99104
```python
100105
import torch
@@ -176,12 +181,6 @@ for epoch in range(num_epochs):
176181
)
177182
```
178183

179-
**Features demonstrated:**
180-
181-
- **Layer filtering**: Only track Conv2d and Linear layers (reduces overhead)
182-
- **Custom statistics**: Use mean, std, hist instead of all 8 statistics
183-
- **Phase-specific tracking**: Different tracking strategies for train/validation
184-
- **Frequency control**: Track every 20 steps in training, every 50 in validation
185184

186185
## Features
187186

@@ -316,7 +315,7 @@ NeptuneLogger(
316315
- `tensor_stats`: Statistics to compute (default: `["mean", "norm", "hist"]`)
317316
- `log_model_diagram`: Log the model summary and diagram (default: `False`)
318317

319-
### log_model_internals
318+
### log_model_internals()
320319

321320
```python
322321
log_model_internals(
@@ -338,7 +337,7 @@ log_model_internals(
338337

339338
### Available statistics
340339

341-
| Statistic | Description | Use Case |
340+
| Statistic | Description | Use case |
342341
| ---------- | ----------------------- | ------------------------------------- |
343342
| `mean` | Mean value | Monitor activation levels |
344343
| `std` | Standard deviation | Detect activation variance |
@@ -372,7 +371,7 @@ Contributions to neptune-pytorch are welcome. Here's how you can help:
372371
3. Make your changes and add tests
373372
4. Run tests: `pytest tests/`
374373
5. Commit your changes: `git commit -m 'Add amazing feature'`
375-
6. Push to the branch: `git push origin feature/amazing-feature`
374+
6. Push to remote: `git push origin feature/amazing-feature`
376375
7. Open a Pull Request
377376

378377
## Support

0 commit comments

Comments
 (0)