Skip to content

Instantly share code, notes, and snippets.

View tail-call's full-sized avatar
🐚
Conch in the Shell

Maria tail-call

🐚
Conch in the Shell
View GitHub Profile
@tail-call
tail-call / LangchainSammoWrapper.py
Created August 19, 2025 08:13
LSW.py and Friends
import json
import warnings
from typing import Any
from sammo.runners.base import BaseRunner
from sammo.base import LLMResult, Costs
from sammo.schemas import JsonSchema
from sammo.utils import serialize_json
from langchain_core.language_models.base import BaseLanguageModel
@tail-call
tail-call / GradientChecker.py
Created June 26, 2025 08:20
A bunch of files I deleted from CGT4NN repository, archiving here just in case
from cgtnnlib.LearningTask import LearningTask
from cgtnnlib.nn.AugmentedReLUNetwork import AugmentedReLUNetwork
from cgtnnlib.training import train_model
from cgtnnlib.datasets import datasets
import torch.optim as optim
p = 0.5
dataset = datasets[0]
model = AugmentedReLUNetwork(
@tail-call
tail-call / Theorems.csv
Created April 27, 2025 05:48
100 Greatest Theorems
We can make this file beautiful and searchable if this error is corrected: No commas found in this CSV file in line 0.
Position;Theorem;Author;Collective;Comment;Date Lower;Date Upper;Uncertain Date
1;The Irrationality of the Square Root of 2;Pythagoras and his school;;;-500;;
2;Fundamental Theorem of Algebra;Karl Frederich Gauss;;;1799;;
3;The Denumerability of the Rational Numbers;Georg Cantor;;;1867;;
4;Pythagorean Theorem;Pythagoras and his school;;;-500;;
5;Prime Number Theorem;Jacques Hadamard;;;1896;;
5;Prime Number Theorem;Charles-Jean de la Vallee Poussin;;;1896;;
6;Godel’s Incompleteness Theorem;Kurt Godel;;;1931;;
7;Law of Quadratic Reciprocity;Karl Frederich Gauss;;;1801;;
8;The Impossibility of Trisecting the Angle and Doubling the Cube;Pierre Wantzel;;;1837;;
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <errno.h>
// Структура для аргументов (предположим, что она уже определена)
typedef struct {
int s;
} arguments;
@tail-call
tail-call / utils.py
Created December 16, 2024 08:02
This is the Python Function to Solve the Universe Problem of All Times, and I share it with you, but you must not tell anyone that the Universe Problem of All Times is finally solved
import torch
def dabs_mean_std(
tensor1: torch.Tensor,
tensor2: torch.Tensor
):
dabs: torch.Tensor = torch.abs(tensor2 - tensor1)
mean = torch.mean(dabs)
std = torch.std(dabs)
@tail-call
tail-call / cons.lua
Last active August 11, 2025 09:36
This amazing gist compares performance of using multiple return values in Lua as a data structure compared to tables, tables turn out performing better
---@generic A, D
---@param head A
---@param tail D
---@return fun(): A, D
local function cons(head, tail)
return function ()
return head, tail
end
end
@tail-call
tail-call / claqz3.f
Created December 7, 2024 16:19
Beautiful Fortran Code
*> \brief \b CLAQZ3
*
* =========== DOCUMENTATION ===========
*
* Online html documentation available at
* http://www.netlib.org/lapack/explore-html/
*
*> \htmlonly
*> Download CLAQZ3 + dependencies
*> <a href="http://www.netlib.org/cgi-bin/netlibfiles.tgz?format=tgz&filename=/lapack/lapack_routine/CLAQZ3.f">
#lang racket
(define/contract (reverse x)
(-> exact-integer? exact-integer?)
(cond ((= x 0) 0)
((< x 0) (- (reverse (- x))))
(else (let ((reduced-x (floor (/ x 10)))
(digit (remainder (floor x) 10))
(z (expt 10 (round (log x 10)))))
diff --git a/cgt-nn-rev6wip.ipynb b/cgt-nn-rev6wip.ipynb
index 25792be..0b03781 100644
--- a/cgt-nn-rev6wip.ipynb
+++ b/cgt-nn-rev6wip.ipynb
@@ -910,45 +910,45 @@
" <td>...</td>\n",
" </tr>\n",
" <tr>\n",
- " <th>835</th>\n",
- " <td>evaluate_RegularNetwork_2_p0.99_N9</td>\n",
import curses
from curses import wrapper
from typing import Any
import torch
import torch.nn as nn
import torch.optim as optim
from cgtnnlib.datasets import breast_cancer_dataset, car_evaluation_dataset, student_performance_factors_dataset
from cgtnnlib.AugmentedReLUNetwork import AugmentedReLUNetwork
from cgtnnlib.RegularNetwork import RegularNetwork
from cgtnnlib.training import train_model