This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
N, E, D =range,len,True; import numpy as A | |
def F(x):return 0.5*x*(1+A.tanh(A.sqrt(2/A.pi)*(x+0.044715*x**3))) | |
def G(x):B=A.exp(x-A.max(x,axis=-1,keepdims=D));return B/A.sum(B,axis=-1,keepdims=D) | |
def C(x,g,b,eps=1e-5):return g*(x-A.mean(x,axis=-1,keepdims=D))/A.sqrt(A.var(x,axis=-1,keepdims=D)+eps)+b | |
def B(x,w,b):return x@w+b | |
def H(x,c_fc,c_proj):return B(F(B(x,**c_fc)),**c_proj) | |
def I(x,c_attn,c_proj,n_head):x=B(x,**c_attn);return B(A.hstack([G([email protected]/A.sqrt(B.shape[-1])+(1-A.tri(x.shape[0],dtype=x.dtype))*-1e10)@D for(B,C,D)in zip(*list(map(lambda x:A.split(x,n_head,axis=-1),A.split(x,3,axis=-1))))]),**c_proj) | |
def J(x,mlp,attn,ln_1,ln_2,n_head):x=x+I(C(x,**ln_1),**attn,n_head=n_head);x=x+H(C(x,**ln_2),**mlp);return x | |
def K(i,wte,wpe,blocks,ln_f,n_head): | |
A=wte[i]+wpe[range(len(i))] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php /* | |
************************************************************************** | |
Plugin Name: SyntaxHighlighter Evolved | |
Plugin URI: https://alex.blog/wordpress-plugins/syntaxhighlighter/ | |
Version: 3.6.2 | |
Description: Easily post syntax-highlighted code to your site without having to modify the code at all. Uses Alex Gorbatchev's <a href="http://alexgorbatchev.com/SyntaxHighlighter/">SyntaxHighlighter</a>. Includes a new editor block. | |
Author: Alex Mills (Viper007Bond) | |
Author URI: https://alex.blog/ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
use std::time; | |
fn get_test_matrix() -> Vec<Vec<f64>> { | |
let mut x: Vec<Vec<f64>> = vec![vec![0.; 790]; 500000]; | |
for i in 0..x.len() { | |
for j in 0..x[0].len() { | |
x[i][j] = fastrand::f64() * 500.; | |
} | |
} | |
x |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Docker Image CI | |
env: | |
GIT_NAME: ${{ secrets.GIT_NAME }} | |
GIT_EMAIL: ${{ secrets.GIT_EMAIL }} | |
GIT_USER: ${{ secrets.GIT_USER }} | |
GIT_TOKEN: ${{ secrets.GIT_TOKEN }} | |
on: | |
push: |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import pymongo | |
import numpy as np | |
from os import path | |
import os | |
from PIL import Image | |
import matplotlib.pyplot as plt | |
from collections import Counter | |
from wordcloud import WordCloud, STOPWORDS | |
d = path.dirname(__file__) if "__file__" in locals() else os.getcwd() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
https://launchpad.net/~ubuntu-security/+archive/ubuntu/ppa/+build/11218704/+files/tar_1.28-2.1ubuntu0.1_arm64.deb |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Copyright 2015 The TensorFlow Authors. All Rights Reserved. | |
# | |
# Licensed under the Apache License, Version 2.0 (the "License"); | |
# you may not use this file except in compliance with the License. | |
# You may obtain a copy of the License at | |
# | |
# http://www.apache.org/licenses/LICENSE-2.0 | |
# | |
# Unless required by applicable law or agreed to in writing, software | |
# distributed under the License is distributed on an "AS IS" BASIS, |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public class RoundedImageView extends ImageView { | |
public RoundedImageView(Context context) { | |
super(context); | |
// TODO Auto-generated constructor stub | |
} | |
public RoundedImageView(Context context, AttributeSet attrs) { | |
super(context, attrs); | |
} | |
public RoundedImageView(Context context, AttributeSet attrs, int defStyle) { | |
super(context, attrs, defStyle); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Clean the background noise, if color != black, then set to white. | |
for y in xrange(img.size[1]): | |
for x in xrange(img.size[0]): | |
if not(pixdata[x, y][0] > threshold \ | |
and pixdata[x, y][1] > threshold \ | |
and pixdata[x, y][2] > threshold): | |
pixdata[x, y] = (0, 0, 0, 255) | |
else: | |
pixdata[x, y] = (255, 255, 255, 255) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/python | |
""" | |
tesseract | |
========= | |
A package for measuring the concentration of halos from Nbody simulations | |
non-parametrically using Voronoi tessellation. | |
Subpackages | |
----------- |