Skip to content

Instantly share code, notes, and snippets.

Avatar
😀

Bastiaan Quast bquast

😀
View GitHub Profile
View pluto-install-error-HTTP.jl
Installed Tables ────────────────────── v1.7.0
Installed ExproniconLite ────────────── v0.6.13
Installed IteratorInterfaceExtensions ─ v1.0.0
Installed DataValueInterfaces ───────── v1.0.0
Installed MsgPack ───────────────────── v1.1.0
Installed OrderedCollections ────────── v1.4.1
Installed IniFile ───────────────────── v0.5.1
Installed FuzzyCompletions ──────────── v0.5.0
Installed MIMEs ─────────────────────── v0.1.4
Installed URIs ──────────────────────── v1.4.0
@bquast
bquast / attention.R
Last active Jun 23, 2022
R implementation of attention, see blog post: https://qua.st/attention-in-R
View attention.R
# attention.R
# Bastiaan Quast
# bquast@gmail.com
# based on:
# https://machinelearningmastery.com/the-attention-mechanism-from-scratch/
# encoder representations of four different words
word_1 = matrix(c(1,0,0), nrow=1)
word_2 = matrix(c(0,1,0), nrow=1)
View dkms-build.log
DKMS make.log for darling-mach-r3717.26e55e111 for kernel 5.18.3-arch1-1 (x86_64)
Thu 16 Jun 16:41:19 CEST 2022
Running kernel version is 5.18.3-arch1-1
rm -f darling-mach.mod.o
make -C /lib/modules/5.18.3-arch1-1/build M=/var/lib/dkms/darling-mach/r3717.26e55e111/build modules
make[1]: Entering directory '/usr/lib/modules/5.18.3-arch1-1/build'
Running kernel version is 5.18.3-arch1-1
Invoked by kernel build system, building for 5.18.3-arch1-1
CC [M] /var/lib/dkms/darling-mach/r3717.26e55e111/build/osfmk/ipc/ipc_entry.o
In file included from /var/lib/dkms/darling-mach/r3717.26e55e111/build/osfmk/mach/port.h:90,
View darling-dkms.log
DKMS make.log for darling-mach-r3717.26e55e111 for kernel 5.18.3-arch1-1 (x86_64)
Thu 16 Jun 08:47:47 CEST 2022
Running kernel version is 5.18.3-arch1-1
rm -f darling-mach.mod.o
make -C /lib/modules/5.18.3-arch1-1/build M=/var/lib/dkms/darling-mach/r3717.26e55e111/build modules
make[1]: Entering directory '/usr/lib/modules/5.18.3-arch1-1/build'
Running kernel version is 5.18.3-arch1-1
Invoked by kernel build system, building for 5.18.3-arch1-1
CC [M] /var/lib/dkms/darling-mach/r3717.26e55e111/build/osfmk/ipc/ipc_entry.o
In file included from /var/lib/dkms/darling-mach/r3717.26e55e111/build/osfmk/mach/port.h:90,
View Ravuri.vtt
WEBVTT
0
00:00:01.040 --> 00:00:02.620
Good morning, good afternoon, good evening
1
00:00:02.780 --> 00:00:04.059
and welcome to Ai for good.
View gist:167a1e923454870fe74fdb651e1b66f5
[ 10%] Building C object src/external/libxpc/CMakeFiles/xpc_obj.dir/src/activity.m.o
In file included from /home/bquast/Downloads/darling-git/src/darling/src/external/libxpc/src/activity.m:22:
In file included from /home/bquast/Downloads/darling-git/src/darling/src/external/libxpc/internal-include/xpc/util.h:29:
In file included from /home/bquast/Downloads/darling-git/src/darling/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/os/log.h:11:
/home/bquast/Downloads/darling-git/src/darling/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/os/trace.h:55:16: warning: GCC does not allow 'format' attribute in this position on a function definition [-Wgcc-compat]
__attribute__((format(printf, 1, 2)))
^
1 warning generated.
In file included from /home/bquast/Downloads/darling-git/src/darling/src/external/libxpc/src/activity.m:22:
In file included from /home/bquast/Downloads/darling-git/src/darling/src/external/libxpc/internal-include/xpc/util.h:29:
View darling-PKGBUILD
# Maintainer: James Brink <brink.james@gmail.com>
# Contributor: X0rg
_gitname=darling
pkgbase=$_gitname-git
pkgname=('darling-git' 'darling-mach-dkms-git')
pkgver=r3682.97fc8eeaa
pkgrel=1
pkgdesc="Darwin/macOS emulation layer for Linux"
arch=('x86_64')
View simple-self-attention.R
# logsumexp
logsumexp <- function (x) {
y = max(x)
y + log(sum(exp(x - y)))
}
# softmax
softmax <- function (x) {
exp(x - logsumexp(x))
}
View tensor.R
# contructor function
tensor <- function(x) {
# check that it's numeric
if (!is.numeric(x)) stop("X must be numeric")
# create the array and change the class
y <- structure(array(x), class = "tensor")
# add attributes
attributes(y)$creators <- list()
View Ring-Learning-With-Errors.py
import numpy as np
import sys
def gen_poly(n,q):
global xN_1
l = 0 #Gamma Distribution Location (Mean "center" of dist.)
poly = np.floor(np.random.normal(l,size=(n)))
while (len(poly) != n):
poly = np.floor(np.random.normal(l,size=(n)))
poly = np.floor(p.polydiv(poly,xN_1)[1]%q)