Skip to content

docs: Revamp README to be simpler#761

Open
KhusPatel4450 wants to merge 9 commits into
mainfrom
KhusPatel4450-patch-1
Open

docs: Revamp README to be simpler#761
KhusPatel4450 wants to merge 9 commits into
mainfrom
KhusPatel4450-patch-1

Conversation

@KhusPatel4450

@KhusPatel4450 KhusPatel4450 commented Jun 29, 2026

Copy link
Copy Markdown
Contributor

Updated README to improve clarity on TorchJD's features and usage, including new sections on scalarization and Jacobian descent.

EDIT by Valérian: To quickly take a look at the formatted README, click this: https://github.com/SimplexLab/TorchJD/blob/KhusPatel4450-patch-1/README.md

Updated README to improve clarity on TorchJD's features and usage, including new sections on scalarization and Jacobian descent.
@KhusPatel4450 KhusPatel4450 requested a review from a team as a code owner June 29, 2026 13:03
@KhusPatel4450 KhusPatel4450 added cc: docs Conventional commit type for changes to the documentation. cc: refactor Conventional commit type for any refactoring, not user-facing, and not typing or perf improvements cc: chore Conventional commit type for changes to some configuration files of the project. labels Jun 29, 2026
@KhusPatel4450 KhusPatel4450 changed the title Revise README for enhanced clarity and structure docs: Revamp README to include scalarization and simplify entry point Jun 29, 2026
@KhusPatel4450 KhusPatel4450 removed cc: refactor Conventional commit type for any refactoring, not user-facing, and not typing or perf improvements cc: chore Conventional commit type for changes to some configuration files of the project. labels Jun 29, 2026
@KhusPatel4450 KhusPatel4450 changed the title docs: Revamp README to include scalarization and simplify entry point docs: Revamp README to be simpler Jun 29, 2026

@PierreQuinton PierreQuinton left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks a lot for the PR, looking forward to improve the README.

I think the state you propose is nice, but maybe it brings something bad to the users: I'm afraid they will essentially just try some of the Scalarizers and then figure that it doesn't work for them, even though it is possible that JD would help them. It would be nice to bring back some importance to JD, saying that even if Scalarization is a good baseline, it is suggested to try using aggregators to try to resolve conflict as it can resolve problems that might be impossible to solve with standard scalarizers.

Comment thread README.md
Comment thread README.md Outdated
Comment thread README.md Outdated
Comment thread README.md Outdated
Comment thread README.md
Comment thread README.md Outdated
Comment thread README.md Outdated
Comment thread README.md Outdated
Comment thread README.md Outdated
Comment thread README.md Outdated
@KhusPatel4450

This comment was marked as outdated.

@KhusPatel4450

This comment was marked as outdated.

@KhusPatel4450

This comment was marked as resolved.

Comment thread README.md Outdated
Comment thread README.md Outdated

@PierreQuinton PierreQuinton left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think it would be nice to restore content about autojac and autogram at the end of the file (after the list of aggregs and scalarizers), it is an interesting piece of the lib that some people may want to use even without using aggregation.

Comment thread README.md
@ValerianRey

This comment was marked as resolved.

@ValerianRey

Copy link
Copy Markdown
Member

I think it would be nice to restore content about autojac and autogram at the end of the file (after the list of aggregs and scalarizers), it is an interesting piece of the lib that some people may want to use even without using aggregation.

I think it's a bit too long. Maybe we could talk about autogram, and hype people about it in like 3 lines, but just use links to the documentation for the actual examples?

@KhusPatel4450

KhusPatel4450 commented Jun 30, 2026

Copy link
Copy Markdown
Contributor Author

Hello this new commit has pretty much all comments addressed, I went in the direction of what Valerian said about the autogram engines.

@PierreQuinton PierreQuinton left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

looks good to me, we are not talking about autojac at all then? (I'm fine with it, just asking)

Comment thread README.md Outdated
Co-authored-by: Pierre Quinton <pierre.quinton@epfl.ch>
@KhusPatel4450

Copy link
Copy Markdown
Contributor Author

I think autojac can be exaplained in that potential video we talked about, or sperately somewhere else. I think the main page though should largely stick to the two main contributions which is the scalarizers and aggregators.

And maybe that should be the theme around the video too but the video should probably be more general rather than getting too too technical

@ValerianRey

Copy link
Copy Markdown
Member

I really like it a lot, thanks a lot for this PR and for the changes @KhusPatel4450 !

Comment thread README.md Outdated
Comment thread README.md Outdated
Comment thread README.md Outdated
Comment thread README.md
Comment on lines +52 to +75
```diff
import torch
from torch.nn import Linear, MSELoss, ReLU, Sequential
from torch.optim import SGD

+ from torchjd.scalarization import GeometricMean

model = Sequential(Linear(10, 5), ReLU(), Linear(5, 1))
optimizer = SGD(model.parameters(), lr=0.1)
criterion = MSELoss()
+ scalarizer = GeometricMean()

inputs = torch.randn(16, 10)
task1_targets, task2_targets = torch.randn(16, 1), torch.randn(16, 1)

output = model(inputs)
- loss = criterion(output, task1_targets) + criterion(output, task2_targets)
- loss.backward()
+ losses = torch.stack([criterion(output, task1_targets), criterion(output, task2_targets)])
+ loss = scalarizer(losses)
+ loss.backward()
optimizer.step()
optimizer.zero_grad()
```

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is it possible to use the same examples as for JD, i.e. have a training loop with 8 batches of data? I would be nice if everything is the same between the two examples except for what matters: scalarization vs JD.

Co-authored-by: Pierre Quinton <pierre.quinton@epfl.ch>
Co-authored-by: Valérian Rey <31951177+ValerianRey@users.noreply.github.com>
Comment thread README.md Outdated
@ValerianRey

Copy link
Copy Markdown
Member

I think it would be nice to restore content about autojac and autogram at the end of the file (after the list of aggregs and scalarizers), it is an interesting piece of the lib that some people may want to use even without using aggregation.

I like the length of the new autogram section: very short, but straight to the point and a good way to make people want to try it. I think we could add a paragraph of a similar size, just before it, for autojac.

@KhusPatel4450 KhusPatel4450 left a comment

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

thank you for link change

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

cc: docs Conventional commit type for changes to the documentation.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants