You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

GBDT_internal.h 986B

12345678910111213141516171819202122232425262728293031323334
  1. // representation of a state used while searching for the best split
  2. typedef struct {
  3. real leftGradientSum, rightGradientSum;
  4. real leftHessianSum, rightHessianSum;
  5. real lossInParent;
  6. long nExampleInLeftBranch, nExampleInRightBranch;
  7. real *grad_data, *hessian_data;
  8. } nn_(GBState);
  9. // representation for the best state found for a given feature
  10. typedef struct {
  11. nn_(GBState) state;
  12. real gain;
  13. long feature_id;
  14. real feature_value;
  15. int valid_state;
  16. } nn_(GBBestState);
  17. // full data that must be initialized before calling the optimizer
  18. typedef struct {
  19. // *_index represent positions on the lua stack
  20. int dataset_index;
  21. int splitInfo_index;
  22. int input_index;
  23. // position of the dataset's function to return the samples ordered for a given feature
  24. int getSortedFeature_index;
  25. // samples that this node has to evaluate
  26. THLongTensor *exampleIds;
  27. // cached gradient and hessian for all data
  28. THTensor *grad;
  29. THTensor *hess;
  30. } nn_(GBInitialization);