-
Notifications
You must be signed in to change notification settings - Fork 291
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Igor lig 724 write python script to test milestone 01 (#726)
* Update imagenette results with new models * Update benchmark results for ImageNette * Add script and update tutorial * Remove `.` from title * Update title * Implement feedback * Update text * Implement feedback
- Loading branch information
1 parent
4688bc9
commit 2c15ac8
Showing
4 changed files
with
224 additions
and
117 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
import lightly | ||
|
||
# we create the Lightly client to connect to the API | ||
client = lightly.api.ApiWorkflowClient(token="TOKEN") | ||
|
||
# create a new dataset using Python code | ||
# and connect it to an existing S3 bucket | ||
client.create_dataset('dataset-name') | ||
client.set_s3_config( | ||
resource_path="s3://bucket/dataset", | ||
region="eu-central-1", | ||
access_key="KEY", | ||
secret_access_key="SECRET", | ||
thumbnail_suffix=None, | ||
) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,73 @@ | ||
import lightly | ||
|
||
# we create the Lightly client to connect to the API | ||
# don't forget to pass the dataset_id if you don't use the client from the | ||
# previous snippet (create a dataset) | ||
client = lightly.api.ApiWorkflowClient(token="TOKEN", dataset_id="DATASET_ID") | ||
|
||
# schedule the compute run using our custom config | ||
# We show here the full default config you can easily edit the | ||
# value according to your need. | ||
client.schedule_compute_worker_run( | ||
worker_config={ | ||
'stopping_condition': { | ||
'n_samples': 10, | ||
'enable_corruptness_check': True, | ||
'remove_exact_duplicates': True, | ||
'enable_training': False, | ||
'pretagging': False, | ||
'pretagging_debug': False, | ||
'method': 'coreset', | ||
'stopping_condition': { | ||
'n_samples': 0.1, | ||
'min_distance': -1 | ||
}, | ||
'scorer': 'object-frequency', | ||
'scorer_config': { | ||
'frequency_penalty': 0.25, | ||
'min_score': 0.9 | ||
} | ||
} | ||
}, | ||
lightly_config={ | ||
'loader': { | ||
'batch_size': 16, | ||
'shuffle': True, | ||
'num_workers': -1, | ||
'drop_last': True | ||
}, | ||
'model': { | ||
'name': 'resnet-18', | ||
'out_dim': 128, | ||
'num_ftrs': 32, | ||
'width': 1 | ||
}, | ||
'trainer': { | ||
'gpus': 1, | ||
'max_epochs': 100, | ||
'precision': 32 | ||
}, | ||
'criterion': { | ||
'temperature': 0.5 | ||
}, | ||
'optimizer': { | ||
'lr': 1, | ||
'weight_decay': 0.00001 | ||
}, | ||
'collate': { | ||
'input_size': 64, | ||
'cj_prob': 0.8, | ||
'cj_bright': 0.7, | ||
'cj_contrast': 0.7, | ||
'cj_sat': 0.7, | ||
'cj_hue': 0.2, | ||
'min_scale': 0.15, | ||
'random_gray_scale': 0.2, | ||
'gaussian_blur': 0.5, | ||
'kernel_size': 0.1, | ||
'vf_prob': 0, | ||
'hf_prob': 0.5, | ||
'rr_prob': 0 | ||
} | ||
} | ||
) |