Barycenter problem #481
              
                Unanswered
              
          
                  
                    
                      cbaldassari
                    
                  
                
                  asked this question in
                Q&A
              
            Replies: 0 comments
  
    Sign up for free
    to join this conversation on GitHub.
    Already have an account?
    Sign in to comment
  
        
    
Uh oh!
There was an error while loading. Please reload this page.
-
Hey, I am seeking clarification on an example presented on the page https://pythonot.github.io/auto_examples/barycenters/plot_barycenter_1D.html.
I managed to replicate the code in the notebook and obtain the displayed outputs.
However, I encounter an issue when I try to make a slight change.
I am referring to the following part of the notebook:
I have attempted to replace the highlighted lines in red with the following:
aa=gmm1.sample(n)[0][:,0]
bb=gmm2.sample(n)[0][:,0]
aa1=np.histogram(aa, bins=n)
aa2=np.histogram(bb, bins=n)
a1=aa1[1]
a2=aa2[1]
In this modification, I am using models derived from sklearn Gaussian mixtures (gmm1 and gmm2) instead of 1D Gauss.
However, I receive the following error:
ValueError: operands could not be broadcast together with shapes (2,101) (100,)
I wonder if you could kindly help me resolve this issue, thank you!
Beta Was this translation helpful? Give feedback.
All reactions