IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Ignore:
Timestamp:
Mar 18, 2019, 5:02:59 PM (7 years ago)
Author:
eugene
Message:

cleanup opihi sort functions; add deimos fitobj function

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/Ohana/src/opihi/cmd.data/nnet_train.c

    r40371 r40642  
    33// these are local only
    44float nnet_sigmoid (float value);
    5 void  nnet_sortseq (float *X, int *Y, int N);
    65int   nnet_onelayer (Nnet *nnet, int L);
    76void  nnet_reset_Nabla (Nnet *nnet);
     
    191190    // generate a random sequence : used to select random mini batches
    192191    for (int i = 0; i < Ntrial; i++) { seq[i] = i; rnd[i] = drand48(); }
    193     nnet_sortseq (rnd, seq, Ntrial);
     192    sort_float_index (rnd, seq, Ntrial);
    194193
    195194    int Npass = Ntrial / Nmini;
     
    514513  return 1.0 / (1.0 + exp(-value));
    515514}
    516 
    517 void nnet_sortseq (float *X, int *Y, int N) {
    518 
    519 # define SWAPFUNC(A,B){ float ftmp; int itmp;   \
    520     ftmp = X[A]; X[A] = X[B]; X[B] = ftmp;      \
    521     itmp = Y[A]; Y[A] = Y[B]; Y[B] = itmp;      \
    522   }
    523 # define COMPARE(A,B)(X[A] < X[B])
    524 
    525   OHANA_SORT (N, COMPARE, SWAPFUNC);
    526 
    527 # undef SWAPFUNC
    528 # undef COMPARE
    529 
    530 }
    531 
Note: See TracChangeset for help on using the changeset viewer.