01/13/2012. From a lecture by Professor John Ousterhout at Stanford, class CS140
Here's today's thought for the weekend. A little bit of slope makes up for a lot of Y-intercept.
[Laughter]
| """Demo of how to pop up plots asynchronously using separate processes.""" | |
| from multiprocessing import Process | |
| import time | |
| import sys | |
| import matplotlib.pyplot as plt | |
| import numpy as np | |
| def demo(): | |
| i = 0 | |
| processes = [] |
| import random, numpy | |
| def genGuess(N,W,H): | |
| '''Generate sensible initial guess vector (random circle coordinates and radii)''' | |
| z=numpy.zeros(3*N) | |
| for i in xrange(0,N): | |
| z[i*3]=random.random()*W | |
| z[i*3+1]=random.random()*H | |
| z[i*3+2]=0.001*min(W,H)+random.random()*(0.009*min(W,H)) | |
| return(z) |
| #!/usr/bin/env python | |
| """ | |
| Example of using Keras to implement a 1D convolutional neural network (CNN) for timeseries prediction. | |
| """ | |
| from __future__ import print_function, division | |
| import numpy as np | |
| from keras.layers import Convolution1D, Dense, MaxPooling1D, Flatten | |
| from keras.models import Sequential |
In Sep, 2021, Jupyterlab Desktop App (electron) was released by Mehmet Bektas (github repo).
brew install --cask jupyterlab| function concat_and_crop(mx::AbstractArray{T,4}, x::AbstractArray{T,4}) where T | |
| w, h = size(x) | |
| mw, mh = size(mx) | |
| rx = (1:mw) .+ ((w - mw) ÷ 2) | |
| ry = (1:mh) .+ ((h - mh) ÷ 2) | |
| return cat(x[rx, ry, :, :], mx, dims = 3) | |
| end | |
| create_model_2d_classes() = Chain( | |
| BatchNorm(1), |
| # Visualise a latex document git history | |
| # loop through commits, create a PDF from your main file for each | |
| # translate the pages of that PDF to a single image | |
| # create GIF/mp4 from the folder of images created | |
| # run within your local repository | |
| # prerequisites: ImageMagick and FFmpeg | |
| # create output folder |