Invoke is a Python package used to make tasks executed by CLI.
Your Python code looks like this:
Invoke is a Python package used to make tasks executed by CLI.
Your Python code looks like this:
An image generated at resolution 512x512 then upscaled to 1024x1024 with Waifu Diffusion 1.3 Epoch 7.
In most of deep learning projects, the training scripts always start with lines to load in data, which can easily take a handful minutes. Only after data ready can start testing my buggy code. It is so frustratingly often that I wait for ten minutes just to find I made a stupid typo, then I have to restart and wait for another ten minutes hoping no other typos are made.
In order to make my life easy, I devote lots of effort to reduce the overhead of I/O loading. Here I list some useful tricks I found and hope they also save you some time.
use Numpy Memmap to load array and say goodbye to HDF5.
I used to relay on HDF5 to read/write data, especially when loading only sub-part of all data. Yet that was before I realized how fast and charming Numpy Memmapfile is. In short, Memmapfile does not load in the whole array at open, and only later "lazily" load in the parts that are required for real operations.
Sometimes I may want to copy the full array to memory at once, as it makes later operations
; À compiler avec nasm -felf64 cat.asm && ld cat.o -o cat | |
%define SYS_EXIT 60 | |
%define SYS_READ 0 | |
%define SYS_WRITE 1 | |
%define SYS_OPEN 2 | |
%define SYS_CLOSE 3 | |
%define STDOUT 1 | |
%define BUFFER_SIZE 2048 |
#------------------------------------------------------------------------------- | |
# lexer.py | |
# | |
# A generic regex-based Lexer/tokenizer tool. | |
# See the if __main__ section in the bottom for an example. | |
# | |
# Eli Bendersky (eliben@gmail.com) | |
# This code is in the public domain | |
# Last modified: August 2010 | |
#------------------------------------------------------------------------------- |
D [0-9] | |
L [a-zA-Z_] | |
H [a-fA-F0-9] | |
E ([Ee][+-]?{D}+) | |
P ([Pp][+-]?{D}+) | |
FS (f|F|l|L) | |
IS ((u|U)|(u|U)?(l|L|ll|LL)|(l|L|ll|LL)(u|U)) | |
%{ | |
#include <stdio.h> |