Skip to content

Instantly share code, notes, and snippets.

View SubhadityaMukherjee's full-sized avatar

Subhaditya Mukherjee SubhadityaMukherjee

View GitHub Profile
def get_event_files(main_path) -> list:
"""Return a list of event files under the given directory"""
all_files = []
for root, _, filenames in os.walk(main_path):
for filename in filenames:
if "events.out.tfevents" in filename:
all_files.append(str(Path(root) / Path(filename)))
return all_files
"""
Run result aggregator
- Read all tensorbord logs and save as a pandas dataframe for analysis
"""
import os
import pandas as pd
from tensorboard.backend.event_processing.event_accumulator import EventAccumulator
from tqdm import tqdm
from pathlib import Path
@SubhadityaMukherjee
SubhadityaMukherjee / tb_log_parser.py
Created March 16, 2023 10:51
parse_query_tb_logs
import os
import pandas as pd
from tensorboard.backend.event_processing.event_accumulator import EventAccumulator
from tqdm import tqdm
from pathlib import Path
import numpy as np
import matplotlib.pyplot as plt
import clipboard
import base64
from io import BytesIO
import clipboard
import os
from pathlib import Path
import re
def apply_transforms(txt, list_of_trans):
for trans in list_of_trans:
txt = trans(txt)
return txt
@SubhadityaMukherjee
SubhadityaMukherjee / create_tag_pages.py
Created October 25, 2022 12:22
Create Tag pages script for Obsidian
import os
from glob import glob
from pathlib import Path
import re
#%%
main_dir = Path("./docs/") # Change this to where your Obsidian Vault notes are
# %%
files = glob(str(main_dir) + "/**/*.md", recursive=True) # This looks at all markdown files
files.sort()
pdfannots <filename>
# eg : pdfannots /Users/eragon/Documents/paper.pdf
pip install pdfannots
@SubhadityaMukherjee
SubhadityaMukherjee / latex_report_bib.tex
Created September 9, 2022 16:01
latex_report_parts
\bibliographystyle{IEEEtran}
\bibliography{references}
\end{document}
@SubhadityaMukherjee
SubhadityaMukherjee / latex_report_cite.tex
Created September 9, 2022 16:01
latex_report_parts
\section{Citation Example}
Two interesting libraries are Kornia \cite{riba2020kornia} and fast.ai \cite{howard2020fastai}. If you want it inline then : \citep{howard2020fastai}.
%\newpage %add this if you want it to be on a separate page
\begin{appendix}
\listoffigures
\listoftables
\end{appendix}