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

Suggestion: MD5-hashed config for duplication checking #467

Closed
wants to merge 4 commits into from

Conversation

exilef
Copy link

@exilef exilef commented Apr 28, 2019

Hi, I have implemented duplication checking of Experiments in a new class called NoDuplicateExperiment. For this I had to add MD5 computation capabilities. Just as an inspiration..

Example usage:

from sacred.no_duplicate_experiment import NoDuplicateExperiment, DuplicateCheckerMongo
from sacred.observers import MongoObserver

MONGO_HOST = 'localhost'
MONGO_PORT = 27017
MONGO_DB = 'sacred'

exp = NoDuplicateExperiment('test',
  duplicate_checker = DuplicateCheckerMongo(MONGO_HOST, MONGO_PORT, MONGO_DB),
  ignored_params = ('parameter2', ))
exp.observers.append(
  MongoObserver.create(url = '{}:{}'.format(MONGO_HOST, MONGO_PORT), db_name = MONGO_DB))

@exp.config
def config():
  parameter1 = 1
  parameter2 = 'ignored'

@exp.automain
def run(parameter1, parameter2):
  return parameter1 + 1

@coveralls
Copy link

coveralls commented Apr 28, 2019

Coverage Status

Coverage decreased (-0.4%) to 83.54% when pulling c8fab79 on exilef:master into 40ac2bc on IDSIA:master.

@JarnoRFB JarnoRFB mentioned this pull request May 15, 2019
@stale
Copy link

stale bot commented May 28, 2019

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

@stale stale bot added the stale label May 28, 2019
@stale stale bot closed this Jun 4, 2019
@Qwlouse
Copy link
Collaborator

Qwlouse commented Jun 20, 2019

Reopening, because this is a quite useful start for duplicate detection. I am not sure how I feel about having a separate experiment class, though. It seems more useful to have a flag that prevents starting a duplicate.

@Qwlouse Qwlouse reopened this Jun 20, 2019
@stale stale bot removed the stale label Jun 20, 2019
@stale
Copy link

stale bot commented Sep 18, 2019

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

@stale stale bot added the stale label Sep 18, 2019
@exilef
Copy link
Author

exilef commented Sep 19, 2019

I have this in place and it works well.

@stale stale bot removed the stale label Sep 19, 2019
@stale
Copy link

stale bot commented Dec 18, 2019

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

@stale stale bot added the stale label Dec 18, 2019
@stale stale bot closed this Dec 25, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants