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
""" | |
Implementation of the Early stopping method. | |
Usage: | |
>>> es = EarlyStopping(patience=2) | |
>>> es.early_stop | |
False | |
>>> es(2) | |
>>> es.early_stop | |
False |
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
# Given a list represented as "element1 element2 element3 ..." | |
# Given an element | |
# This is a function that returns "yes" or "no" whether the list contains the string | |
contains() { | |
# $1 is the list | |
# $2 is the element to look for | |
if echo "$1" | grep -q "$2"; then | |
echo "yes" | |
else |