Category Archives: Software

CUDA Installation

Getting Started Guide: C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v7.0\doc\html\cuda-getting-started-guide-for-microsoft-windows\index.html there is a lot of documentation to be found at: C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v7.0\doc\pdf After installing CUDA you get this directory where all samples are stored: C:\ProgramData\NVIDIA Corporation\CUDA Samples\v7.0 the bin\Win64\Debug and Release … Continue reading

Posted in Software | Leave a comment

AWS / Unix / Deep Learning

How to Remote Desktop to Ubuntu: follow instructions at: https://aws.amazon.com/premiumsupport/knowledge-center/connect-to-linux-desktop-from-windows/ one bit of instruction is missing in above link and that has to do with enabling RDP traffic to your server (allow a client machine to communicate with server over … Continue reading

Posted in Software | Leave a comment

Most important lesson of software development: more is not better

Most important lesson of software development if you are a manager: in case the point is not clear: First of all, the productivity does not increase in proportion to the # of devs i.e., if you double the devs, it … Continue reading

Posted in Software | Leave a comment

Testing Logistic Regression on linearly inseparable data

generate data: x=rnorm(1000,mean=0) y=rnorm(1000,mean=10) obs1=data.frame(rbind(cbind(rnorm(1000),rnorm(1000)),cbind(rnorm(1000,mean=10),rnorm(1000,mean=10))),as.factor(“Class A”)) obs2=data.frame(rbind(cbind(x,y),cbind(y,x)),as.factor(“Class B”)) colnames(obs1) = c(“x”, “y”, “class”) colnames(obs2) = c(“x”, “y”, “class”) df=rbind(obs1,obs2) make scatter plot: #scatter plot #dev.new() png(file=”scatter.png”) plot(obs1$x,obs1$y,col=colors[[1]],xlab=”x”,ylab=”y”,main=”scatter plot”) points(obs2$x,obs2$y,col=colors[[2]]) dev.off() see histograms: for(i in 1:2) { #dev.new() png(file=paste(“hist-“,names[[i]],”.png”,sep=””)) hist(obs1[,i],col=colors[[1]]) hist(obs2[,i],col=colors[[2]],add=TRUE) … Continue reading

Posted in Software | Leave a comment

Testing Logistic Regression

create training data: visualize: result: D = \frac{|\mu_1-\mu_2|}{\sigma_1+\sigma_2}: histograms of x and y: build classifier: Output: algorithm fails to converge because of perfect separation: compute AUC: where: plot AUC: result: LDA: finally you add add some noise to make logistic … Continue reading

Posted in Software | Leave a comment

Performance in R

Here is a function to compute (false positive, true positive) pair given response, ground truth, classes and threshold: This function is 100x slower than below which does the same thing: To benchmark, install rbenchmark package and use it like below:

Posted in Software | Leave a comment

R Notes

getwd to get current working directory (analogous to pwd) setwd to set current working directory options(digits=3) will print numbers with 3 decimal digits runif(20) – create vector of 20 uniformly distributed random numbers dir – to list files in a … Continue reading

Posted in Software | Leave a comment

Overlaying SVG on top of canvas

http://jsfiddle.net/siddjain/wwLCD/ http://jsfiddle.net/siddjain/Hq63y/1/

Posted in Software | Leave a comment

Canvas and SVG Continued

Sample 1: measure text in canvas using context.measureText Sample 2: bounding box calculation for SVG using getBBox method. SVG also provides getComputedTextLength method to calculate text width Sample 3: breaking up hindi text into constituent characters in javascript Sample 4: … Continue reading

Posted in Software | Leave a comment

Performance Testing SVG & Canvas

SVG: Sample 1: Create 100 SVG labels, put them in a group, and apply a translate transform to the group in each frame Sample 2: Same as sample 1, except that no group is created, and a translate transform is … Continue reading

Posted in Software | Leave a comment