Operation system: Raspbery Pi OS (Debian 10)
QEMU emulator version: 2+
| #install termux from f-droid | |
| #copy commands or just use the command: | |
| # pkg install curl -y && curl -s https://gist.githubusercontent.com/BenjaminWegener/94c3a293994b3050cff880c4f802fd62/raw/92b1c7056764af7e8548f66b4412c0615da46175/gistfile1.txt | bash | |
| termux-setup-storage | |
| pkg update -y | |
| pkg upgrade -y | |
| pkg install wget build-essential cmake git -y | |
| git clone https://github.com/antimatter15/alpaca.cpp | |
| cd alpaca.cpp |
| // LICENSE | |
| // ======= | |
| // Copyright (c) 2017-2019 Advanced Micro Devices, Inc. All rights reserved. | |
| // ------- | |
| // 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: | |
| // ------- | |
| // The above copyright notice and this permission notice shall be included in all copies or substantial portions of the |
| -install userland from fdroid | |
| -setup debian with ssh | |
| -get wlan ip from android | |
| -connect to ssh via putty/connectbot etc - port is 2022 | |
| sudo apt update -y | |
| sudo apt install -y wget unzip mariadb-server mariadb-client php php-{cli,xml,zip,curl,gd,cgi,mysql,mbstring} apache2 libapache2-mod-php | |
| sudo mysql | |
| CREATE DATABASE nextcloud; | |
| CREATE USER admin@localhost IDENTIFIED BY 'password'; | |
| GRANT ALL PRIVILEGES ON nextcloud.* TO admin@localhost; |
| #!/bin/bash | |
| #set -e | |
| # install-wifi - 03/05/2021 - by MrEngman. | |
| UPDATE_SELF=${UPDATE_SELF:-1} | |
| UPDATE_URI="http://downloads.fars-robotics.net/wifi-drivers/install-wifi" | |
| ROOT_PATH=${ROOT_PATH:-"/"} | |
| WORK_PATH=${WORK_PATH:-"${ROOT_PATH}/root"} |
| import tensorflow as tf | |
| def entmax15(inputs, axis=-1): | |
| """ | |
| Entmax 1.5 implementation, heavily inspired by | |
| * paper: https://arxiv.org/pdf/1905.05702.pdf | |
| * pytorch code: https://github.com/deep-spin/entmax | |
| :param inputs: similar to softmax logits, but for entmax1.5 | |
| :param axis: entmax1.5 outputs will sum to 1 over this axis | |
| :return: entmax activations of same shape as inputs |
| //--------------------------------------------------- | |
| //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'; |
| var assert = require( 'assert' ); | |
| function findFrequentBigram( s ) { | |
| var i, freqs = {}, topFreq = 0, topPair = null, bigram; | |
| for ( i = 0; i < s.length; i += 2 ) { | |
| bigram = s.slice( i, i + 2 ); | |
| freq = ++freqs[bigram]; |
| javascript:(function(){ | |
| console.log("Working"); | |
| document.querySelector("colab-toolbar-button#connect").click() | |
| }.setInterval(60000)) |
| def sub_pixel_conv(inputs, height, width, out_channels): #keras version of 2x pixel shuffle | |
| x = inputs | |
| x = SeparableConv2D(out_channels * 4, kernel_size = 9, depth_multiplier = 1, activation = 'tanh', padding = 'same')(x) | |
| x = Reshape((height, width, out_channels, 2, 2))(x) | |
| x = Permute((3, 2, 4, 1, 5))(x) | |
| x = Reshape((out_channels, height * 2, height * 2))(x) | |
| x = Permute((2, 3, 1))(x) | |
| return x |