1/* 2 * Copyright (C) 2012 The Android Open Source Project 3 * 4 * Licensed under the Apache License, Version 2.0 (the "License"); 5 * you may not use this file except in compliance with the License. 6 * You may obtain a copy of the License at 7 * 8 * http://www.apache.org/licenses/LICENSE-2.0 9 * 10 * Unless required by applicable law or agreed to in writing, software 11 * distributed under the License is distributed on an "AS IS" BASIS, 12 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 * See the License for the specific language governing permissions and 14 * limitations under the License. 15 */ 16 17// Contains definitions commom to all classification and ranking algorithms 18// in this package. 19 20#ifndef LEARNING_STOCHASTIC_LINEAR_COMMON_DEFS_H_ 21#define LEARNING_STOCHASTIC_LINEAR_COMMON_DEFS_H_ 22 23namespace learning_stochastic_linear { 24// Defines standard types of regulariation methods. 25enum RegularizationType { L0, L1, L2, L1L2, L1LInf }; 26 27// Defines standard adaptation modes for which Stochastic Sub-Gradient 28// methods are known to converge. 29enum AdaptationMode { CONST, INV_LINEAR, INV_QUADRATIC, INV_SQRT }; 30enum UpdateType { FULL_CS, CLIP_CS, REG_CS, SL, ADAPTIVE_REG }; 31enum RankLossType { PAIRWISE, RECIPROCAL_RANK }; 32enum KernelType { LINEAR, POLY, RBF }; 33enum MulticlassUpdateType { MAX, RANK }; 34} // namespace learning_stochastic_linear 35 36#ifdef ANDROID 37#define uint32 uint32_t 38#define int32 int32_t 39#define uint64 uint64_t 40#define int64 int64_t 41#include <cutils/log.h> 42#define CHECK_GT(x,y) if (x<y) ALOGE("CHECK_GT failed at file %s line %d", \ 43 __FILE__, __LINE__); 44#endif 45 46#endif // LEARNING_STOCHASTIC_LINEAR_COMMON_DEFS_H_ 47