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
def dice(im1, im2, empty_score=1.0): | |
""" | |
Computes the Dice coefficient, a measure of set similarity. | |
Parameters | |
---------- | |
im1 : array-like, bool | |
Any array of arbitrary size. If not boolean, will be converted. | |
im2 : array-like, bool | |
Any other array of identical size. If not boolean, will be converted. | |
Returns |
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
import tensorflow as tf | |
from pathlib import Path | |
import pandas as pd | |
from tqdm import tqdm | |
from collections import defaultdict | |
# Get all event* runs from logging_dir subdirectories | |
logging_dir = Path('.', 'logs') | |
event_paths = logging_dir.glob('**/event*') |