sudo apt install llvm
echo 'export LLVM_SYMBOLIZER_PATH=/usr/bin/llvm-symbolizer' >> ~/.bashrc
Assuming env located at ~/miniconda3
| from PIL import ImageColor, Image, ImageDraw | |
| from IPython.display import display | |
| cmap = ImageColor.colormap | |
| c, n = 8, len(cmap) | |
| r = ((n - 1) // c) + 1 | |
| ch, cw = 32, 128 | |
| ih, iw = ch * r, cw * c | |
| img = Image.new("RGB", (iw, ih), (0, 0, 0)) | |
| draw = ImageDraw.Draw(img) |
| / powerset, without empty set. (cross uniques) | |
| pset:{raze{raze(flip enlist x:til x-y){(x+z){raze x,''y}'x#\:y}[1+x]/til y-:1}'[x+1;1+til y]} | |
| pset[3]3 | |
| / limit on current machine | |
| / count{raze{raze(flip enlist x:til x-y){(x+z){raze x,''y}'x#\:y}[1+x]/til y-:1}'[x+1;1+til y]}[24]24 |
| #!/bin/bash | |
| set -e | |
| VERSION="3.13.0b4" | |
| VENV_PATH="$HOME/py313" | |
| curl -sS https://www.python.org/ftp/python/3.13.0/Python-$VERSION.tgz | tar -xz | |
| cd Python-$VERSION | |
| sudo ./configure --disable-gil |
| #todo:cli | |
| from webbrowser import open_new_tab as o | |
| q='sedenion-valued MLP';(h:='https://');[o(_)for _ in[f'{_}{q}'for _ in[f'{h}bing.com/search?q=',f'{h}google.com/search?q=',f'{h}yandex.ru/search?text=',f'{h}baidu.com/s?wd=',f'{h}search.yahoo.com/search?p=',f'{h}duckduckgo.com/?q=']]]; |
| import os | |
| import warnings | |
| from shutil import rmtree | |
| from tempfile import mkdtemp | |
| from typing import Dict, Iterable, Any | |
| import numpy as np | |
| import pandas as pd | |
| from IPython.core.display import display, HTML | |
| from keras.callbacks import EarlyStopping |
| / powerset, without empty set. (cross uniques) | |
| pset:{raze{raze(flip enlist x:til x-y){(x+z){raze x,''y}'x#\:y}[1+x]/til y-:1}'[x+1;1+til y]} | |
| pset[3]3 | |
| / limit on current machine | |
| / count{raze{raze(flip enlist x:til x-y){(x+z){raze x,''y}'x#\:y}[1+x]/til y-:1}'[x+1;1+til y]}[24]24 |
| using Combinatorics | |
| using IterTools | |
| function calculate(U, sets) | |
| solution_set = Set() | |
| Threads.@threads for s in sets | |
| A,B,C =Set(s[1]),Set(s[2]),Set(s[3]) | |
| conditions = [ | |
| (A ∩ setdiff(U,B) ∩ setdiff(U,C)) == (setdiff(U,A) ∩ B ∩ C) | |
| Set(1) ⊆ ((A ∪ C) ∩ setdiff(B, C)) |
| from itertools import chain, combinations, permutations | |
| from typing import Iterator, Tuple, Generator | |
| def calculate(U: set, num_sets: int) -> Iterator[Tuple[set, ...]]: | |
| sets: Generator[set,...] = (set(x) for x in | |
| chain.from_iterable(combinations(U, r) | |
| for r in range(1, len(U) + 1))) | |
| i = 0 | |
| for s in permutations(sets,num_sets): | |
| A, B, C = s |