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
# -*- coding:utf-8 -*- | |
""" | |
Place this script on a directory and convert the .exr files it contains | |
into np.float32 matrices | |
""" | |
import os | |
import OpenEXR |
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
#!/usr/bin python | |
# -*- coding:utf-8 -*- | |
""" | |
""" | |
import os | |
import h5py |
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
#!/usr/bin python | |
# -*- coding:utf-8 -*- | |
""" | |
This module features convenient color logger (wrapping the built-in ``loging.`` | |
class), plus some helper functionality. | |
""" | |
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
################################################################################ | |
### server.py | |
################################################################################ | |
#!/usr/bin/env python | |
# -*- coding:utf-8 -*- | |
""" | |
Dummy server, interacts with the client receiving, altering and returning |
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 matplotlib.pyplot as plt | |
import matplotlib.font_manager as plt_fm | |
class PltFontManager: | |
""" | |
Sometimes matplotlib finds the system font paths, but setting them can | |
still be challenging due to using the wrong name or matplotlib complaining | |
about missing elements. | |
This manager static class is intended to aid with that, by facilitating |
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
from collections import defaultdict | |
import random | |
class SubsetSampler(torch.utils.data.Sampler): | |
""" | |
Like ``torch.utils.data.SubsetRandomsampler``, but without the random, | |
and with the possibility of balanced sampling. Samples a subset of the | |
given dataset from a given list of indices, without replacement. | |
Usage example:: |
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
#!/usr/bin/env python | |
# -*-coding:utf-8-*- | |
""" | |
This module contains 2 functions: | |
* ``cose_recovery``: Implements the L1 compressed sensing program, allowing | |
for L2 error tolerance in the constraint. | |
* ``cose_recovery_mpp``: Parallelized version of ``cose_recovery`` that runs |
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
#!/usr/bin/env python | |
# -*- coding:utf-8 -*- | |
""" | |
!!! WARNING !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! | |
The quantities computed in this gist are wrong. While a correction is | |
pending, see the following discussion for more details. The TLDR is that | |
they must be divided by batch_size^2, or use the alternative Cockpit |
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
#!/usr/bin/env python | |
# -*-coding:utf-8-*- | |
""" | |
This module contains a minimal example to illustrate one of the main | |
implications of the compressed sensing paradigm: That a perfect recovery of a | |
sparse signal is possible with a number of measurements that depends on the | |
signal sparsity, and not on the signal length. |
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
interactive_gpu() | |
{ | |
# needed by getopt: https://stackoverflow.com/a/5048356 | |
local OPTIND | |
# default parameter values | |
seconds=300 | |
partition="large" | |
# parse flags to optionally override param defaults |
NewerOlder