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 typing import Dict, Tuple | |
import torch | |
from torch import Tensor | |
class OnlineKappa: | |
""" | |
Computes an online version of the Cohen's Kappa Coefficient. |
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 os | |
from typing import Any, Callable, Tuple | |
import torch | |
from torchvision.datasets.utils import ( | |
download_and_extract_archive, | |
check_integrity, | |
download_url, | |
) | |
from PIL import Image |
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 typing import Tuple | |
import torch | |
from torch import Tensor, nn | |
def get_hook(mod_name: str, layer_name: str, check_inf: bool = True): | |
def hook(_module: nn.Module, input: Tuple, output: Tuple) -> None: | |
for i, t in enumerate(input): |
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
### A Pluto.jl notebook ### | |
# v0.17.7 | |
using Markdown | |
using InteractiveUtils | |
# ╔═╡ bc0afc08-4320-4fdd-a09c-06c553c30db8 | |
import Pkg | |
# ╔═╡ e9c29457-523f-432e-abaf-800f4c3cbb7b |
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
""" | |
A small list of utilities to transform dataclasses from argparsers | |
""" | |
from typing import List, Optional | |
import argparse | |
import dataclasses | |
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
#!python | |
""" | |
Downloads Zotero files that are not synced on this laptop. | |
""" | |
import os | |
from pathlib import Path | |
import argparse | |
import sqlite3 |
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
# This file is machine-generated - editing it directly is not advised | |
julia_version = "1.7.2" | |
manifest_format = "2.0" | |
[[deps.ANSIColoredPrinters]] | |
git-tree-sha1 = "574baf8110975760d391c710b6341da1afa48d8c" | |
uuid = "a4c015fc-c6ff-483c-b24f-f7ea428134e9" | |
version = "0.0.1" |
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
### A Pluto.jl notebook ### | |
# v0.15.0 | |
using Markdown | |
using InteractiveUtils | |
# This Pluto notebook uses @bind for interactivity. When running this notebook outside of Pluto, the following 'mock version' of @bind gives bound variables a default value (instead of an error). | |
macro bind(def, element) | |
quote | |
local el = $(esc(element)) |
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
#!python | |
import argparse | |
from PIL import Image | |
from torchvision import utils, transforms | |
def parse_args(): | |
parser = argparse.ArgumentParser("Image concat") | |
parser.add_argument("inputs", metavar="input", nargs="+") | |
parser.add_argument("output") |
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
#include "channel.h" | |
queue_t *queue_new() { | |
queue_t *queue = malloc(sizeof(queue_t)); | |
queue_init(queue); | |
return queue; | |
} | |
void queue_init(queue_t *queue) { |
NewerOlder