public static extern ErrorType batch_cached_double(SvmKernelType kernelType, MatrixElementType type, SvmBatchTrainerType trainerType, IntPtr trainer, double minLearningRate, int cacheSize, out IntPtr ret);
public static extern ErrorType verbose_batch_cached_float(SvmKernelType kernelType, MatrixElementType type, SvmBatchTrainerType trainerType, IntPtr trainer, float minLearningRate, int cacheSize, out IntPtr ret);
public static extern ErrorType batch_trainer_train(SvmKernelType kernel_type, MatrixElementType type, SvmBatchTrainerType trainer_type, IntPtr trainer, IntPtr x, IntPtr y, out IntPtr ret);
internal static NativeMethods.SvmKernelType ToNativeKernelType(this SvmKernelType kernelType) { switch (kernelType) { case SvmKernelType.HistogramIntersection: return(NativeMethods.SvmKernelType.Histogramintersection); case SvmKernelType.Linear: return(NativeMethods.SvmKernelType.Linear); case SvmKernelType.Offset: return(NativeMethods.SvmKernelType.Offset); case SvmKernelType.Polynomial: return(NativeMethods.SvmKernelType.Polynomial); case SvmKernelType.RadialBasis: return(NativeMethods.SvmKernelType.RadialBasis); case SvmKernelType.Sigmoid: return(NativeMethods.SvmKernelType.Sigmoid); default: throw new ArgumentOutOfRangeException(nameof(kernelType), kernelType, null); } }
public static extern ErrorType kcentroid_operator_float(SvmKernelType kernelType, MatrixElementType type, int templateRows, int templateColumns, IntPtr obj, IntPtr sample, out float ret);
public static extern ErrorType kkmeans_operator(SvmKernelType kernelType, MatrixElementType type, int templateRows, int templateColumns, IntPtr kkmeans, IntPtr sample, out uint ret);
public static void GetTypes <TScalar, TTrainer>(out Type trainerType, out NativeMethods.SvmBatchTrainerType svmTrainerType, out SvmKernelType svmKernelType, out MatrixElementTypes sampleType) where TScalar : struct where TTrainer : Trainer <TScalar> { trainerType = typeof(TTrainer); var svmTrainer = trainerType.GetGenericTypeDefinition(); if (!BatchTrainerTypesRepository.Types.TryGetValue(svmTrainer, out svmTrainerType)) { throw new ArgumentException(); } var kernelType = trainerType.GenericTypeArguments[1].GetGenericTypeDefinition(); if (!KernelTypesRepository.KernelTypes.TryGetValue(kernelType, out svmKernelType)) { throw new ArgumentException(); } var elementType = trainerType.GenericTypeArguments[0]; if (!KernelTypesRepository.ElementTypes.TryGetValue(elementType, out sampleType)) { throw new ArgumentException(); } }
public static extern ErrorType krls_train_double(SvmKernelType kernelType, MatrixElementType type, int templateRows, int templateColumns, IntPtr obj, IntPtr x, double y);
public static extern ErrorType deserialize_krls(byte[] filName, SvmKernelType kernelType, MatrixElementType matrixElementType, int templateRows, int templateColumns, IntPtr obj, out IntPtr errorMessage);
public static extern ErrorType normalized_function_set_function(SvmKernelType kernelType, MatrixElementType type, int templateRows, int templateColumns, SvmFunctionType function_type, IntPtr function, IntPtr sub_function);
public static extern ErrorType kkmeans_get_kcentroid(SvmKernelType kernelType, MatrixElementType type, int templateRows, int templateColumns, IntPtr kkmeans, uint i, out IntPtr kcentroid);
public static extern ErrorType decision_function_operator_float(SvmKernelType kernelType, MatrixElementType type, int templateRows, int templateColumns, IntPtr function, IntPtr sample, out float ret);
public static extern ErrorType krls_operator_double(SvmKernelType kernelType, MatrixElementType type, int templateRows, int templateColumns, IntPtr obj, IntPtr sample, out double ret);
public static extern ErrorType normalized_function_get_normalizer(SvmKernelType kernelType, MatrixElementType type, int templateRows, int templateColumns, SvmFunctionType function_type, IntPtr function, out IntPtr ret);
public static extern ErrorType deserialize_decision_function(byte[] filName, SvmKernelType kernelType, MatrixElementType matrixElementType, int templateRows, int templateColumns, out IntPtr function, out IntPtr errorMessage);
public static extern ErrorType svm_pegasos_new2_double(SvmKernelType kernelType, MatrixElementType type, IntPtr kernel, double lambda, double tolerance, uint max_num_sv, out IntPtr ret);
public static TKernel Create <TKernel, TScalar, TSample>(IntPtr ptr, SvmKernelType kernelType, int templateRow, int templateColumn, bool isEnabledDispose = true) where TKernel : KernelBase where TScalar : struct where TSample : Matrix <TScalar>, new() { switch (kernelType) { case SvmKernelType.HistogramIntersection: return(new HistogramIntersectionKernel <TScalar, TSample>(ptr, templateRow, templateColumn, isEnabledDispose) as TKernel); case SvmKernelType.Linear: return(new LinearKernel <TScalar, TSample>(ptr, templateRow, templateColumn, isEnabledDispose) as TKernel); case SvmKernelType.Polynomial: return(new PolynomialKernel <TScalar, TSample>(ptr, templateRow, templateColumn, isEnabledDispose) as TKernel); case SvmKernelType.RadialBasis: return(new RadialBasisKernel <TScalar, TSample>(ptr, templateRow, templateColumn, isEnabledDispose) as TKernel); case SvmKernelType.Sigmoid: return(new SigmoidKernel <TScalar, TSample>(ptr, templateRow, templateColumn, isEnabledDispose) as TKernel); default: throw new ArgumentOutOfRangeException(nameof(kernelType), kernelType, null); } }
public KernelBaseParameter(SvmKernelType kernelType, MatrixElementTypes sampleType, int templateRows, int templateColumns) { this.KernelType = kernelType; this.SampleType = sampleType; this.TemplateRows = templateRows; this.TemplateColumns = templateColumns; }
public static extern ErrorType rank_features(SvmKernelType kernelType, MatrixElementType type, int templateRows, int templateColumns, IntPtr kcentroid, IntPtr samples, IntPtr labels, out IntPtr ret);
public static extern ErrorType krls_new(SvmKernelType kernelType, MatrixElementType type, int templateRows, int templateColumns, IntPtr kernel, double tolerance, uint maxDictionarySize, out IntPtr ret);
public static extern ErrorType spectral_cluster(SvmKernelType kernelType, MatrixElementType type, int templateRows, int templateColumns, IntPtr kernel, IntPtr samples, uint numClusters, out IntPtr ret);
public static extern ErrorType kkmeans_train(SvmKernelType kernelType, MatrixElementType type, int templateRows, int templateColumns, IntPtr kkmeans, IntPtr samples, IntPtr centers, uint max_iter);
public static extern ErrorType serialize_krls(SvmKernelType kernelType, MatrixElementType type, int templateRows, int templateColumns, IntPtr obj, byte[] fileName, int fileNameLength, out IntPtr errorMessage);
public static extern ErrorType serialize_probabilistic_decision_function(SvmKernelType kernelType, MatrixElementType type, int templateRows, int templateColumns, IntPtr function, byte[] fileName, int fileNameLength, out IntPtr errorMessage);
public static extern ErrorType normalized_function_operator_float(SvmKernelType kernel_type, MatrixElementType type, int templateRows, int templateColumns, SvmFunctionType function_type, IntPtr function, IntPtr sample, out float ret);
public static extern ErrorType batch_trainer_new2_float(SvmKernelType kernelType, MatrixElementType type, SvmBatchTrainerType trainerType, IntPtr trainer, float minLearningRate, bool verbose, bool useCache, int cacheSize, out IntPtr ret);
public static extern ErrorType reduced2(SvmKernelType kernel_type, MatrixElementType type, int templateRows, int templateColumns, SvmTrainerType trainer_type, IntPtr trainer, uint num_bv, double eps, out IntPtr ret);
public static extern ErrorType kcentroid_new(SvmKernelType kernelType, MatrixElementType type, int templateRows, int templateColumns, IntPtr kernel, double tolerance, uint maxDictionarySize, bool removeOldestFirst, out IntPtr ret);
public static extern ErrorType normalized_function_serialize(SvmKernelType kernel_type, MatrixElementType type, int templateRows, int templateColumns, SvmFunctionType function_type, IntPtr function, byte[] file_name, int file_name_length, out IntPtr error_message);
public static extern ErrorType pick_initial_centers(SvmKernelType kernelType, MatrixElementType elementType, int templateRows, int templateColumns, long num_centers, IntPtr centers, IntPtr samples, IntPtr k, double percentile);