Skip to content

Instantly share code, notes, and snippets.

View tiom4eg's full-sized avatar
🥌
4

tiom4eg

🥌
4
View GitHub Profile
@tiom4eg
tiom4eg / dataloader.py
Created October 10, 2025 13:24
dataloader v1
import os, glob
import cv2
import numpy as np
import torch
import matplotlib.pyplot as plt # for testing purposes only
IMG_EXTS = (".png", ".jpg", ".jpeg", ".bmp", ".webp")
def _list_images(folder):
some methods to solve problems:
https://drive.google.com/file/d/1zlAbolrErs992uo9NI2CTi-C8r90ZSWh/view
docs:
https://scikit-learn.org/stable/user_guide.html
https://pytorch.org/docs/stable/torch.html
https://pytorch-ignite.ai/
helpful notebooks:
https://drive.google.com/file/d/104YlPDZxxwmI9A1rT0_M2p1RuHoLbtJ_/view?usp=sharing # torch + perceptron
@tiom4eg
tiom4eg / gist:4d6cebed211fe31e5b1e662254992c72
Created March 31, 2023 17:50
execution time comparison
int_to_str() vs int()
n = 2^1024 - 1
Время выполнения int_to_str(): 0.000 секунд
Время выполнения str(): 0.000 секунд
Коэффициент оптимизации: 0.455
n = 2^2048 - 1
Время выполнения int_to_str(): 0.000 секунд
Время выполнения str(): 0.000 секунд
Коэффициент оптимизации: 0.141
n = 2^4096 - 1
@tiom4eg
tiom4eg / implicit_persistent_range_segtree.cpp
Last active February 23, 2023 14:04
пятикратно переваренный кал, который работает вечность
#include <bits/stdc++.h>
using namespace std;
/*
Node must have empty initializer, (l, r) initializer, tag/push/drop methods and operator+
tag - apply update to node
push - return update that we should apply to children
drop - drop used update
operator+ - combine two nodes
The following Node implementations are just an examples