Skip to content

Commit

Permalink
Merge pull request nf-core#177 from mathysgrapotte/custom_json
Browse files Browse the repository at this point in the history
[feat] custom json can be used even split = None
  • Loading branch information
mathysgrapotte authored Sep 1, 2024
2 parents defb0a0 + 86750b1 commit a903cc2
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 3 deletions.
2 changes: 1 addition & 1 deletion bin/launch_analysis_default.py
Original file line number Diff line number Diff line change
Expand Up @@ -96,7 +96,7 @@ def run_analysis_performance_model(metrics: list, model_path: list, weight_list:
# TODO for the moment I am hard coding the batch size for the forward pass to predict
# but we can make it dynamic in the future
# or depending on the dataset size, etc.
analysis = AnalysisRobustness(metrics, initialized_experiment_class, batch_size=10)
analysis = AnalysisRobustness(metrics, initialized_experiment_class, batch_size=256)

# compute the performance of each model on each dataset
df = analysis.get_performance_table(model_names, model_list, data_list)
Expand Down
5 changes: 4 additions & 1 deletion bin/launch_interpret_json.py
Original file line number Diff line number Diff line change
Expand Up @@ -87,9 +87,12 @@ def interpret_json(input_json: dict) -> list:
# deal wiht custom if present, in this case nothing at all will be done to the dictionaries present in the list except adding the experiment name to it. The user is responsible for the dict inside custom to be correct and ready for the csv_launcher
for custom_dict in schema.custom_arg :
new_dict = {**{"experiment": schema.experiment}, **custom_dict}
if "split" not in custom_dict:
new_dict["split"] = None
list_of_json_to_write.append(new_dict)
# add the split information in each dictionary inside custom
list_split_combinations.append(custom_dict["split"])
if "split" in custom_dict:
list_split_combinations.append(custom_dict["split"])

# append a none value to the list. the pipeline has to go through the case of no split at least once.
list_split_combinations.append(None)
Expand Down
2 changes: 1 addition & 1 deletion bin/src/data/experiments.py
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ class DnaToFloatExperiment(AbstractExperiment):
"""
def __init__(self) -> None:
super().__init__()
self.dna = {'encoder': encoders.TextOneHotEncoder(alphabet='acgt'), 'data_transformation_generators': {'UniformTextMasker': data_transformation_generators.UniformTextMasker(mask='N'), 'ReverseComplement': data_transformation_generators.ReverseComplement()}}
self.dna = {'encoder': encoders.TextOneHotEncoder(alphabet='acgt'), 'data_transformation_generators': {'UniformTextMasker': data_transformation_generators.UniformTextMasker(mask='N'), 'ReverseComplement': data_transformation_generators.ReverseComplement(), 'GaussianChunk': data_transformation_generators.GaussianChunk()} }
self.float = {'encoder': encoders.FloatEncoder(), 'data_transformation_generators': {'GaussianNoise': data_transformation_generators.GaussianNoise()}}
self.split = {'RandomSplitter': splitters.RandomSplitter()}

Expand Down

0 comments on commit a903cc2

Please sign in to comment.