Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update logging setup interface #106

Merged
merged 1 commit into from
Jun 3, 2024
Merged

Update logging setup interface #106

merged 1 commit into from
Jun 3, 2024

Conversation

sangkeun00
Copy link
Collaborator

This is a proposal to clean up the logging setup interface. Previously, logix.setup used to have three keys of log, save, and statistic, and within statistic we additionally forward, backward, and grad. In fact, we only need three keys of forward, backward, and grad as we show below:

from logix.statistic import Log, Covariance

# before
run.setup({"log": "grad", "save": "grad", "statistic": {"forward": [], "backward": [], "grad": [Covariance]}})

# after
run.setup({"forward": [], "bakcward": [], "grad": [Log, Covariance]})

An additional change we introduce is separating save from the logging setup. Instead users can enable saving both globally (dataset-level) or locally (batch-level) as below:

# global
run.save(True) # run.save(False)

# local
with run(data_id=data_id, save=True):
    ...

I believe this interface would ease users to more easily define and plug-in their own statistics computation primitives.

@sangkeun00 sangkeun00 added the enhancement New feature or request label Jun 3, 2024
@sangkeun00 sangkeun00 requested a review from pomonam June 3, 2024 17:59
@sangkeun00 sangkeun00 self-assigned this Jun 3, 2024
@sangkeun00 sangkeun00 merged commit 1ca5ec9 into main Jun 3, 2024
3 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant