This file contains hidden or 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 -*- | |
| """Combining XDiag with Hutch++. | |
| Copyright (C) 2025 aferro (ORCID: 0000-0003-3830-3595) | |
| This program is free software: you can redistribute it and/or modify | |
| it under the terms of the GNU General Public License as published by |
This file contains hidden or 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 -*- | |
| """Exploring out-of-core QR decompositions via dask. | |
| conda create -n dask python=3.10 | |
| conda activate dask | |
| pip install numpy | |
| pip install h5py |
This file contains hidden or 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 hidden or 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 hidden or 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 hidden or 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 hidden or 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 hidden or 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 hidden or 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 |
This file contains hidden or 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 -*- | |
| """ | |
| Most existing breadth-first search implementations provide a solution to | |
| *traverse* a tree, but they don't *return* that specific tree. This module | |
| provides a tree datastructure and BFS implementation to obtain the BFS tree. | |
| """ |
NewerOlder