Note: I didn't use AI to write this. I originally had it try to analyze the profiler GC logs, but there wasn't enough information for it to be conclusive (see below).
| from pytorch_lightning.metrics import Metric | |
| from pytorch_lightning.metrics.functional.classification import ( | |
| stat_scores_multiple_classes | |
| ) | |
| class MCC(Metric): | |
| r""" | |
| Computes `Mathews Correlation Coefficient <https://en.wikipedia.org/wiki/Matthews_correlation_coefficient>`_: | |
| Forward accepts | |
| - ``preds`` (float or long tensor): ``(N, ...)`` or ``(N, C, ...)`` where C is the number of classes |
On an Debian/Ubuntu-based system, to install texlive-full without docs and language packs, simply do this:
sudo apt install `sudo apt --assume-no install texlive-full | \
awk '/The following additional packages will be installed/{f=1;next} /Suggested packages/{f=0} f' | \
tr ' ' '\n' | grep -vP 'doc$' | grep -vP 'texlive-lang' | grep -vP 'latex-cjk' | tr '\n' ' '`After this, if you wish to install the language packs, selectively install them. E.g.:
On an Debian/Ubuntu-based system, to install texlive-full without docs and language packs, simply do this:
sudo apt install `sudo apt --assume-no install texlive-full | \
awk '/The following additional packages will be installed/{f=1;next} /Suggested packages/{f=0} f' | \
tr ' ' '\n' | grep -vP 'doc$' | grep -vP 'texlive-lang' | grep -vP 'latex-cjk' | tr '\n' ' '`After this, if you wish to install the language packs, selectively install them. E.g.:
This note shows how to iteratively retrieve the decoded content of the pages in a PDF file using Python and the pdfminer Python package.
At the time of writing, the latest version of
pdfminerwas used, i.e.,20140328. Thus, as the package seems poorly maintained and prone to API-breaking changes one may have to explicitly install this version for the following code to work.
The following generator will iterate over a PDF file under a given filename and iteratively yield the text content of each PDF page:
Code here takes a DOM Selection Range instance and creates a highlighting for it by using getClientRects. Approach was inspired by marks although here function attempts to find nearest positioned parent element to the commonAncestorContainer and draw all the highilighting rectangles there, this avoids issues with an overflowing content.
- Approach ignores
z-indexwhich isn't great as some element might be overlaying the selection in which case it should not appear, but it does if we use highz-indexvalue. If we use lowz-indexvalue then some elements (possibly ones containing selection) might end up overlaying selection itself. - Rendered selections are scattered all o
Note: We plan to do a thorough documentation pass in the coming weeks to clean up and document the codebase. This document is a very rough draft intended to help intrepid adventurers navigate the jungle until then.
- Cardinality - The number of results a thing would return.
- Intermediate - A value which is necessary to derive the final result, but not part of the result.
- Referential Transparency - The property of always returning exactly the same output given an input.
This is a simple example for using snakemake to automate a basic work pipeline.
Makefiles and GNU Make are awesome for many reasons, and it's unforgivable for any scientist working with data processing pipelines to use them throughout their projects. But Makefiles, while feature-rich, are not really an ideal tool for automating complex data processing pipelines. If, by some chance, your analyses simply require you to collect different data, process them with identical procedures, collate them, and produce a plot, then sure - Makefiles will do. But in analyzing climate model output, I've found that I have to do a lot of quirky hacks to fit this sort of workflow model.
A perfect example is the analysis of hierarchical climate model output. It's quite common to run a climate model multiple times in a factorial factor, changing 2-3 parameters (say, an emissions dataset and a parameterization in the model). While you can pigeon-hole linear da