-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
RMSprop by default; More flexible training; device bugfix; more hyper…
…params in yml; renaming to weight_decay (#36) * Add optimizer_of_name function for dynamic optimizer creation * save more hparams in yml * adding cli to netam for concat_csvs 😂 * device bugfix for SHM model * RMSprop by default! * using UNIX time for walltime, not hours * changing l2_regularization_coeff to weight_decay * making branch length optimization optional
- Loading branch information
Showing
6 changed files
with
104 additions
and
28 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
import fire | ||
import pandas as pd | ||
|
||
|
||
def concatenate_csvs( | ||
input_csvs_str: str, | ||
output_csv: str, | ||
is_tsv: bool = False, | ||
record_path: bool = False, | ||
): | ||
""" | ||
This function concatenates multiple CSV or TSV files into one CSV file. | ||
Args: | ||
input_csvs: A string of paths to the input CSV or TSV files separated by commas. | ||
output_csv: Path to the output CSV file. | ||
is_tsv: A boolean flag that determines whether the input files are TSV. | ||
record_path: A boolean flag that adds a column recording the path of the input_csv. | ||
""" | ||
input_csvs = input_csvs_str.split(",") | ||
dfs = [] | ||
|
||
for csv in input_csvs: | ||
df = pd.read_csv(csv, delimiter="\t" if is_tsv else ",") | ||
if record_path: | ||
df["input_file_path"] = csv | ||
dfs.append(df) | ||
|
||
result_df = pd.concat(dfs, ignore_index=True) | ||
|
||
result_df.to_csv(output_csv, index=False) | ||
|
||
|
||
def main(): | ||
fire.Fire() |
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
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