Skip to content

Commit

Permalink
Merge branch 'master' into Senegal-updates
Browse files Browse the repository at this point in the history
  • Loading branch information
ivanzvonkov authored Mar 19, 2024
2 parents cf5667a + 4c04f2a commit 155be36
Show file tree
Hide file tree
Showing 4 changed files with 16 additions and 14 deletions.
1 change: 1 addition & 0 deletions evaluate.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
"""
Script to evaluate an individual model
"""

from openmapflow.config import PROJECT_ROOT, DataPaths

from src.pipeline_funcs import run_evaluation # noqa: E402
Expand Down
16 changes: 8 additions & 8 deletions src/consensus_utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -174,10 +174,10 @@ def create_consensus_features(consensus_dataframe: pd.DataFrame) -> pd.DataFrame
"""Creates and adds features to consensus dataframe."""

# Convert analysis duration to float
consensus_dataframe[
["set_1_analysis_duration", "set_2_analysis_duration"]
] = consensus_dataframe[["set_1_analysis_duration", "set_2_analysis_duration"]].applymap(
tofloat
consensus_dataframe[["set_1_analysis_duration", "set_2_analysis_duration"]] = (
consensus_dataframe[["set_1_analysis_duration", "set_2_analysis_duration"]].applymap(
tofloat
)
)

# (1)
Expand Down Expand Up @@ -302,10 +302,10 @@ def renaming_func(s):
consensus_dataframe = df1.merge(
df2, left_on=["plotid", "sampleid"], right_on=["plotid", "sampleid"]
)
consensus_dataframe[
["set_1_analysis_duration", "set_2_analysis_duration"]
] = consensus_dataframe[["set_1_analysis_duration", "set_2_analysis_duration"]].applymap(
tofloat
consensus_dataframe[["set_1_analysis_duration", "set_2_analysis_duration"]] = (
consensus_dataframe[["set_1_analysis_duration", "set_2_analysis_duration"]].applymap(
tofloat
)
)

rcolumns = [
Expand Down
12 changes: 6 additions & 6 deletions src/models/classifier.py
Original file line number Diff line number Diff line change
Expand Up @@ -61,9 +61,9 @@ def __init__(
global_classification_layers.append(
nn.Linear(
in_features=hparams.classifier_vector_size,
out_features=1
if i == (num_global_layers - 1)
else hparams.classifier_vector_size,
out_features=(
1 if i == (num_global_layers - 1) else hparams.classifier_vector_size
),
bias=True if i == 0 else False,
)
)
Expand All @@ -82,9 +82,9 @@ def __init__(
local_classification_layers.append(
nn.Linear(
in_features=hparams.classifier_vector_size,
out_features=1
if i == (num_local_layers - 1)
else hparams.classifier_vector_size,
out_features=(
1 if i == (num_local_layers - 1) else hparams.classifier_vector_size
),
bias=True if i == 0 else False,
)
)
Expand Down
1 change: 1 addition & 0 deletions train.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
"""
Script that uses argument parameters to train an individual model
"""

from argparse import ArgumentParser

from datasets import datasets
Expand Down

0 comments on commit 155be36

Please sign in to comment.