Skip to content

Instantly share code, notes, and snippets.

View bitdom8's full-sized avatar

bitdom8 bitdom8

View GitHub Profile
@cyphunk
cyphunk / softmax.js
Last active June 4, 2024 18:19 — forked from vladimir-ivanov/softmax.js
softmax function implementation in js
// Fork & examples for the one-line version by @vladimir-ivanov:
//let softmax = (arr) => (index) => Math.exp(arr[index]) / arr.map(y => Math.exp(y)).reduce((a, b) => a + b);
//
// Also see comments for improvements
function softmax(arr) {
return arr.map(function(value,index) {
return Math.exp(value) / arr.map( function(y /*value*/){ return Math.exp(y) } ).reduce( function(a,b){ return a+b })
})
}
@ecmel
ecmel / select-file.vue
Last active December 20, 2021 09:17
Vuetify Multiple File Select and Preview
<script>
export default {
name: 'VSelectFile',
model: {
prop: 'value',
event: 'change'
},
props: {
label: {
type: String,
@max10rogerio
max10rogerio / slugify.ts
Last active September 29, 2024 22:27
Typescript slug function
// MIT License
// Copyright (c) 2023 Max Rogério
// Permission is hereby granted, free of charge, to any person obtaining a copy
// of this software and associated documentation files (the "Software"), to deal
// in the Software without restriction, including without limitation the rights
// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
// copies of the Software, and to permit persons to whom the Software is
// furnished to do so, subject to the following conditions:
@BenjaminWegener
BenjaminWegener / attention_layer_tfjs
Created April 14, 2021 18:02
Causal Attention Layer Tensorflow.js
//---------------------------------------------------
//setup
var dModel = 256; //dimension of embedding
var INPUTSIZE = 1024; //length of input
var BLOCKS = 3;
var LEARNING_RATE = 0.003;
var OPTIMIZER = tf.train.adam(LEARNING_RATE, beta_1 = 0.85, beta_2 = 0.9, epsilon = 1e-9);
var LOSS = 'categoricalCrossentropy';
var INITIALIZER = 'GlorotUniform';
@koakh
koakh / gist:fbbc37cde630bedcf57acfd4d6a6956b
Last active April 6, 2024 02:04
SurrealDB : How to use signin and signup (server + client nodesjs)
**As a developer you have complete control over the signup and signin functionality...**
```shell
$ surreal sql --conn http://localhost:8000 --user root --pass root --ns test --db test
```
```sql
-- optional : this is the default see --ns test --db test start server flags
-- USE NS test DB test;