how can I test a data set whether it obeys super gaussian distribution - normal-distribution

I got a data set,I used gaussian mixture to model it.And I used BIC(Bayesian Information Criterions) to get the best number of components.However, the data set seems not obey gaussian distribution,but super gaussian distribution,and BIC doesn't work,it gave the wrong answer.So, I need to verify my guess.
The question is how can I test my data set whether it obeys super gaussian distribution. Maybe, some function you konw can sovle this problem,or some method to get the shape parameter.
enter image description here

Simulation? Which you have already generated then simply use a goodness of fit test

Related

How does gradient update work in SimOTA label assignment in YOLOX?

I am confused about how gradient update works for the SimOTA label assignment part in YOLOX.
In Megvii's implementation of the yolo_head.py, there is get_losses function.
A part of the function calls get_assignments function, which implements the SimOTA label assignment strategy mentioned in the original YOLOX paper:
try:
(
gt_matched_classes,
fg_mask,
pred_ious_this_matching,
matched_gt_inds,
num_fg_img,
) = self.get_assignments( # noqa
batch_idx,
num_gt,
total_num_anchors,
gt_bboxes_per_image,
gt_classes,
bboxes_preds_per_image,
expanded_strides,
x_shifts,
y_shifts,
cls_preds,
bbox_preds,
obj_preds,
labels,
imgs,
)
My understanding is:
The get_assignments function has the #torch.no_grad() decorator which would prevent the gradient calculation from taking place in this function during back propagation.
(I believe) This would mean that the return values of the get_assignments function would be treated as pre-computed constants, except that they will be varying for each image & groundtruth input.
Above points suggest that the neural network would be trying to learn something from an (paradoxically) ever-changing pre-computed "constants" for every image input which does not seem to make much sense. Intuition leads me to think that whatever calculation( that could vary across inputs) that results in a loss should be differentiable & BP'ed.
Is there something inaccurate in my understanding of the YOLOX architecture / how BP works?
Upon thinking over my question, I realized that the matching cost matrix obtained from dynamic_k_matching() (inside get_assignments) serves merely as another proxy groundtruth target. There is no reason to compute gradients within a function that creates a target groundtruth.

How LFW dataset used for evaluating facenet model

I am building a face recognition model using facenet. I could in most of the papers, LFW is used for validation. Trying to understand how LFW is used for validation as it has only 1600 classes with more than 2 images out of 5400 classes. Trying to find answers for the following questions
1) For validation, do we need to use only the classes with more than 1 image and neglect the remaining class ?
2) In the below link there are files under the name 'pairs.txt' and 'people.txt'. How is it exactly used ?
http://vis-www.cs.umass.edu/lfw/
To prepare a flipped dataset as a query dataset
You can use original lfw as a reference dataset, and flip it as a query dataset.
check this repo for detail https://github.com/ZhaoJ9014/face.evoLVe.PyTorch/blob/master/util/extract_feature_v1.py.
the author also gave extract_feature_v2.py which adding centre crop before flip.

How can I implement a custom loss function that takes into account multiple predictions of the network?

I am currently implementing a CNN with a custom error function.
The problem I am trying to solve is physics-based, so I can calculate the maximal achievable precision, or to put it another way, I know the best possible (i.e. minimal) standard deviation I can achieve. Those best possible precisions are calculated during the generation of the training data using the Cramer-Rao-lower bound (CRLB).
Right now, my error function looks something like this (in Keras):
def customLoss(yTrue, yPred):
STD = yTrue[:, 10:20]
yTrue = yTrue[:, 0:10]
dev = K.mean(K.abs(K.abs(yTrue - yPred) - STD))
return dev
In this case, I have 10 parameters, so I want to estimate with 10 CRLB's. I put the CRLB's in the target vector just to be able to handle the in the error function.
To my question. This method works, but it is not what I want. The problem is that the error is calculated considering a single prediction of the network, but to be correct the network would have to predict the same dataset/batch multiple times. By doing that I would be able to see the standard deviation of the prediction and use that to calculate the error (I'm using a Bayesian CNN).
Has someone an idea how to implement such a function in Keras or Tensorflow (I would also not mind switching to PyTorch)?

bayesianoptimization in machine learning

Thanks for reading this. I am currently studying bayesoptimization problem and follow the tutorial. Please see the attachment.bayesian optimization tutorial
In page 11, about the acquisition function. Before I raise my question I need state my understanding about bayesian optimization to see if there is anything wrong.
First we need take some training points and assume them as multivariable gaussian ditribution. Then we need use acquisiont function to find the next point we want to sample. So for example we use x1....x(t) as training point then we need use acquisition function to find x(t+1) and sample it. Then we'll assume x1....x(t),x(t+1) as multivariable gaussian ditribution and then use acquisition function to find x(t+2) to sample so on and so forth.
In page 11, seems we need find the x that max the probability of improvement. f(x+) is from the sample training point(x1...xt) and easy to get. But how to get u(x) and that variance here? I don't know what is the x in the eqaution. It should be x(t+1) but the paper doesn't say that. And if it is indeed x(t+1), then how could I get its u(x(t+1))? You may say use equation at the bottom page 8, but we can use that equation on condition that we have found the the x(t+1) and put it into multivariable gaussian distribution. Now we don't know what is the next point x(t+1) so I have no way to calculate, in my opinion.
I know this is a tough question. Thanks for answering!!
In fact I have got the answer.
Indeed it is x(t+1). The direct way is we compute every u and varaince of the rest x outside of the training data and put it into acquisition function to find which one is the maximum.
This is time consuming. So we use nonlinear optimization like DIRECT to get the x that max the acquisition function instead of trying one by one

How to perform cross addition on an image in opencv

i am reading a tutorial and there is an equation as shown in the image. I know that sign in the image called cross addition, but my question is is there any method in opencv that performs cross addition?
This 'plus in a circle' in this context most likely refers to Direct addition of Matrices
In particular, the unary notation ⊕I1..n refers to the construction of a diagonalised matrix of the matrices I.
For example, suppose we have:
There is no single method in OpenCV that performs this but you can easily use existing matrix operations to do it by:
Create output matrix of correct size and init with zeros
Iterate over matrices to be direct added and set appropriate esubrange of output matrix

Resources