Friday, June 10, 2016

DQC Continued

These guys have put out a ton more information on DQC than the other research groups:

http://horn.tau.ac.il/research.html

Software package for QC:

http://horn.tau.ac.il/compact.html

See qc.m and graddesc.m for the core operations.

Descent:

D=xyData;
[V,P,E,dV] = qc (xyData,q,D);
for j=1:4
   for i=1:(steps/4)
       dV=normc(dV')';
       D=D-eta*dV;
       if (rescale)
          D=normr(D);
       end
       [V,P,E,dV] = qc (xyData,q,D);

Lagrangian integration:

function [V,P,E,dV] = qc (ri,q,r)
% function qc
% purpose: performing quantum clustering in n dimensions
% input:
%       ri - a vector of points in n dimensions
%       q - the factor q which determines the clustering width
%       r - the vector of points to calculate the potential for. equals ri if not specified
% output:
%       V - the potential
%       P - the wave function
%       E - the energy
%       dV - the gradient of V
% example: [V,P,E,dV] = qc ([1,1;1,3;3,3],5,[0.5,1,1.5]);
% see also: qc2d
%close all;
if nargin<3
   r=ri;
end;
%default q
if nargin<2
   q=0.5;
end;
%default xi
[pointsNum,dims] = size(ri);
calculatedNum=size(r,1);
% prepare the potential
V=zeros(calculatedNum,1);
dP2=zeros(calculatedNum,1);
% prepare P
P=zeros(calculatedNum,1);
singlePoint = ones(pointsNum,1);
singleLaplace = zeros(pointsNum,1);
singledV1=zeros(pointsNum,dims);
singledV2=zeros(pointsNum,dims);
% prevent division by zero
% calculate V
%run over all the points and calculate for each the P and dP2
for point = 1:calculatedNum
   singlePoint = ones(pointsNum,1);
   singleLaplace = singleLaplace.*0;
   D2=sum(((repmat(r(point,:),calculatedNum,1)-ri).^2)');
   singlePoint=exp(-q*D2)';
   %EXPij=(repmat(singlePoint',calculatedNum,1).*(repmat(singlePoint,1,calculatedNum)));
%      singleLaplace = sum((D2').*singlePoint);
   for dim=1:dims
      singleLaplace = singleLaplace + (r(point,dim)-ri(:,dim)).^2.*singlePoint;
   end;
   for dim=1:dims
      singledV1(:,dim) = (r(point,dim)-ri(:,dim)).*singleLaplace;
   end;
   for dim=1:dims
      singledV2(:,dim) = (r(point,dim)-ri(:,dim)).*singlePoint;
   end;
   P(point) = sum(singlePoint);
   dP2(point) = sum(singleLaplace);
   dV1(point,:)=sum(singledV1,1);
   dV2(point,:)=sum(singledV2,1);
end;
% dill with zero
%v1(find(v1==0)) = min(v1(find(v1)));
%v2x(find(v2x==0)) = min(v2x(find(v2x>0)));
%v2y(find(v2y==0)) = min(v2y(find(v2y>0)));
P(find(P==0)) = min(P(find(P)));
V=-dims/2+q*dP2./P;
E=-min(V);
V=V+E;
%V=q*dP2./P;
for dim=1:dims
   dV(:,dim)=-q*dV1(:,dim)+(V-E+(dims+2)/2).*dV2(:,dim);
end;
dV(find(P==0),:)=0;



Not the greatest / optimal solution on GPU but this exists:

https://github.com/peterwittek/dqc-gpu


Selected thesis

http://horn.tau.ac.il/publications/Thesis_GS.pdf

Non-recursive merge sort.

For those of you who don't like recursion:

http://www.algorithmist.com/index.php/Merge_sort.c

See also:

http://stackoverflow.com/questions/159590/way-to-go-from-recursion-to-iteration

http://stackoverflow.com/questions/1557894/non-recursive-merge-sort

Info and improvements about actual sort used in Java collections:

https://arxiv.org/pdf/1412.0193.pdf

Overview of reservoir computing

One of the best PhD theses I've ever read. Generic introduction to the field of reservoir computing -- which came out of a series of optimizations on the gradient descent step of neural network training.

http://organic.elis.ugent.be/sites/organic.elis.ugent.be/files/Mantas_Lukosevicius_PhD_thesis.pdf


Spark Shuffle Optimizations

This is a little out of date but it's still important / interesting / great background.

http://people.eecs.berkeley.edu/~kubitron/courses/cs262a-F13/projects/reports/project16_report.pdf

DQC (Dynamic Quantum Clustering) updates

First post in a while. Trying to play some catch up on articles here:

To start with, check out this paper
https://arxiv.org/ftp/arxiv/papers/1310/1310.2700.pdf

on analyzing big data using DQC, some pretty dramatic visuals.