-
Notifications
You must be signed in to change notification settings - Fork 2
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Possible bug with ensembleGBdist("euclidean") #24
Comments
@oliverkjohnson can you include a reproducer for me? I.e. script for me to reproduce these results. I looked at the function, and nothing jumps out at me as obviously wrong/different between the You can add code formatting with MATLAB syntax via (note I escaped the backticks so it wouldn't do the formatting): which looks like this: a = 1
print("") |
I was doing it with the Olmsted data, but here's the script with some random input data (results are similar): % generate some random GBs
nGB = 1e2;
coords = get_ocubo(nGB); % norm sqrt(2)
coords = get_octpairs(coords); %symmetrize (using default reference GBO)
coords = normr(coords); % unit norm
% K=50 ensemble using 'omega' distance
pdO = ensembleGBdist(sqrt(2)*coords,sqrt(2)*coords,50,'omega');
% K=50 ensemble using 'euclidean' distance
pdE = ensembleGBdist(sqrt(2)*coords,sqrt(2)*coords,50,'euclidean');
% unsymmetrized scaled euclidean distance
distanceScalingFactor = 2;
pdInputData = distanceScalingFactor*pdist(coords).'; % sub-diagonal lower-triangular values
% true symmetrized toby distance
k = reshape((1:(nGB.^2)).',nGB,nGB);
[i,j] = ind2sub(size(k),k(tril(true(size(k)),-1)));
pdTrue = GBdist4(sqrt(2)*coords(i,:),sqrt(2)*coords(j,:),32,'omega'); % should be norm sqrt(2)
% Plot
figure
plot(rad2deg(pdTrue),rad2deg(pdO),'k.');
axis equal tight;
xlabel('GBdist4(''omega'') [$d_{\Omega}^{\circ}$]','interpreter','latex');
ylabel('ensembleGBdist($K=50$,''omega'') [$d_{\Omega}^{\circ}$]','interpreter','latex');
figure
plot(rad2deg(pdTrue),rad2deg(pdE),'k.');
axis equal tight;
xlabel('GBdist4(''omega'') [$d_{\Omega}^{\circ}$]','interpreter','latex');
ylabel('ensembleGBdist($K=50$,''euclidean'') [$d_{\Omega}^{\circ}$]','interpreter','latex');
figure
plot(rad2deg(pdTrue),rad2deg(pdInputData),'k.');
axis equal tight;
xlabel('GBdist4(''omega'') [$d_{\Omega}^{\circ}$]','interpreter','latex');
ylabel('2*pdist [$d_{\Omega}^{\circ}$]','interpreter','latex'); |
I should also note that in order to get |
@oliverkjohnson thanks for sharing that script. This really helped to get right to debugging. It turns out to have been a bug with how the function I wrote ( Lines 955 to 970 in 9d979e8
I don't appear to have used this number in the published manuscript. When I talk about the max dimension of a VFZ, it's not in an ensemble sense and comes from a different portion of the code. Thank you for catching this! This was meant to be a convenience function, but it's not very convenient if it spits out garbage with the default distance metric. |
The text was updated successfully, but these errors were encountered: