Thursday, October 26, 2017

Quantum Random Numbers

import requests
import json
random_no = json.loads(requests.get(\
"https://qrng.anu.edu.au/API/jsonI.php?length=1&type=uint16").text)['data'][0]
print(random_no)

Friday, October 6, 2017

Probability plot - some random question

# There are 50 similar Red balls, 50 similar blue balls, and  exactly 2 similar jars with 
# infinite capacity.
# How can we distribute the balls in 2 jars, so as to maximize the probability that when a 
# ball is picked randomly it is Red ball.





library(plotly)

calc_prob <- function(R , B){
  
  0.5 * (R/(R+B)) + (0.5* (50-R) /(100-R-B))
  
}


r <- c(1:50)
b <-c(1:50)


p <- outer(r,b,FUN = "calc_prob")

p[is.na(p)] <- 0.5
max(p)

calc_prob(49,50)


plotz








Self Attention

  x → Embedding → MultiHeadAttention → Concat → Project to lower dim → → Add(x) → LayerNorm → FFN → Add → LayerNorm Vocab to embedding t...