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
#!/bin/bash | |
# Schedules and Resources | |
#SBATCH --nodes=1 | |
##SBATCH --ntasks-per-node=1 | |
##SBATCH --cpus-per-task=2 | |
#SBATCH --mem=16GB | |
#SBATCH --time=24:00:00 # Default: one-hour 01:00:00 | |
# GPU resources to request |
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
# Predefined Locations | |
VENV_HOME=$HOME/venv | |
ETC_HOME=$HOME/etc | |
## Virtual environments | |
venv() { | |
source $VENV_HOME/$1/bin/activate |
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
"""Code Snippet for counting FLOPs of a model. | |
Not final version, it will be updated to improve the usability. | |
""" | |
import os.path | |
import tempfile | |
import tensorflow as tf |
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 | |
class SessionContextManager(object): | |
"""Session context management of tensorflow session and graph. | |
This class handles a default session and a default graph at once | |
for both Tensorflow and Keras. | |
""" |