| Work | Details |
|---|---|
| Augmenting convnets with aggregated attention | Tutorial by Aritra |
| Train a Vision Transformer on small datasets | Tutorial by Aritra |
| MobileViT | Tutorial by Sayak |
| Compact Convolutional Transformers | Tutorial by Sayak |
| Data efficient image transformers | TF implementation, TF pre-trained models, tutorial by Sayak |
| Class attention image transformers | TF implementation, TF pre-trained models by Sayak |
| Masked Autoencoders | TF implementation, tutorial by Aritra and Sayak, Contribution to Hugging Face Transformers by Aritra and Sayak |
| Probing the representation of ViTs |
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 transformers import ( | |
| AutoConfig, | |
| AutoTokenizer, | |
| BitsAndBytesConfig, | |
| GenerationConfig, | |
| AutoModelForCausalLM, | |
| LlamaTokenizerFast, | |
| PreTrainedModel, | |
| TextIteratorStreamer, | |
| StoppingCriteria, |
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
| # Four lines intentionally left blank | |
| # SPDX-FileCopyrightText: 2025 geisserml <geisserml@gmail.com> | |
| # SPDX-License-Identifier: Apache-2.0 OR MPL-2.0 | |
| # See also https://github.com/extremeheat/JSPyBridge/blob/master/examples/python/pdfjs.py |
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 argparse | |
| import contextlib | |
| import logging | |
| import math | |
| import random | |
| import time | |
| from dataclasses import dataclass | |
| from pathlib import Path | |
| from typing import Callable |
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 torch | |
| import torch._inductor.config | |
| import time | |
| torch._inductor.config.triton.cudagraphs = False | |
| torch.set_float32_matmul_precision('high') | |
| def bench(f, name=None, iters=100, warmup=5, display=True, profile=False): | |
| for _ in range(warmup): | |
| f() |
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
| # Copyright 2022 Google LLC. | |
| # SPDX-License-Identifier: Apache-2.0 | |
| # Author: Maithra Raghu <maithra@google.com> | |
| def compute_distance_matrix(patch_size, num_patches, length): | |
| """Helper function to compute distance matrix.""" | |
| distance_matrix = np.zeros((num_patches, num_patches)) |
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 | |
| # Any copyright is dedicated to the Public Domain. | |
| # https://creativecommons.org/publicdomain/zero/1.0/ | |
| # Written by Francois Fleuret <francois@fleuret.org> | |
| # Modified by François Lagunas <francois.lagunas@m4x.org> | |
| import time, torch |
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
| struct SearchBar : View { | |
| @Binding var searchText: String | |
| var body: some View { | |
| HStack { | |
| Image(systemName: "magnifyingglass").foregroundColor(.secondary) | |
| TextField( | |
| $searchText, | |
| placeholder: Text("Search")) { | |
| UIApplication.shared.keyWindow?.endEditing(true) |
The following script, given someone's last name, prints a CSV of financial disclosure PDFs (the first 20, for simplicity's sake) as found on the House Financial Disclosure Reports. It's meant to be a proof-of-concept of how to scrape ASPX (and other "stateful" websites) with using plain old requests -- without too much inconvenience -- rather than resorting to something heavy like the selenium websdriver
The search page can be found here: http://clerk.house.gov/public_disc/financial-search.aspx
Here's a screenshot of what it does when you search via web browser:
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 numpy as np | |
| from numba import jit | |
| from numba import float64 | |
| from numba import int64 | |
| @jit((float64[:], int64), nopython=True, nogil=True) | |
| def _ewma(arr_in, window): | |
| r"""Exponentialy weighted moving average specified by a decay ``window`` | |
| to provide better adjustments for small windows via: |
