C RUBY-ON-RAILS MYSQL ASP.NET DEVELOPMENT RUBY .NET LINUX SQL-SERVER REGEX WINDOWS ALGORITHM ECLIPSE VISUAL-STUDIO STRING SVN PERFORMANCE APACHE-FLEX UNIT-TESTING SECURITY LINQ UNIX MATH EMAIL OOP LANGUAGE-AGNOSTIC VB6 MSBUILD

# Optimizing SMO with RBFKernel (C and gamma)

By : rprimeaux
Date : October 28 2020, 04:55 PM
I wish this help you Hastie et al.'s SVMPath explores the entire regularization path for C and only requires about the same computational cost of training a single SVM model. From their paper:
Our R function SvmPath computes all 632 steps in the mixture example (n+ = n− = 100, radial kernel, γ = 1) in 1.44(0.02) secs on a pentium 4, 2Ghz linux machine; the svm function (using the optimized code libsvm, from the R library e1071) takes 9.28(0.06) seconds to compute the solution at 10 points along the path. Hence it takes our procedure about 50% more time to compute the entire path, than it costs libsvm to compute a typical single solution.
code :

Share :

## Optimizing SMO with RBFKernel (C and gamma) in Weka

By : user3837939
Date : March 29 2020, 07:55 AM
Using logarithmic steps XExpression = pow(BASE,I), XMin = -5, XMax = 5, XStep = 1 and XBase = 10 (same for Y). Using a filter For my purposes I used a DistributionBasedBalance filter with p set to some value. Increasing the number of execution slots I set numExecutionSlots to 4 (the number of cores in my machine).

## gamma correction formula : .^(gamma) or .^(1/gamma)?

By : Ashish poojary
Date : March 29 2020, 07:55 AM
I wish this help you Gamma correction controls the overall brightness of an image. Images which are not corrected can look either bleached out or too dark. Suppose a computer monitor has 2.2 power function as an intensity to voltage response curve. This just means that if you send a message to the monitor that a certain pixel should have intensity equal to x, it will actually display a pixel which has intensity equal to x2.2 Because the range of voltages sent to the monitor is between 0 and 1, this means that the intensity value displayed will be less than what you wanted it to be. Such a monitor is said to have a gamma of 2.2.
code :
``````Corrected = 255 * (Image/255)^(1/2.2).
``````

## R for optimizing a function which involves the gamma function

By : S. Rodgers
Date : March 29 2020, 07:55 AM
To fix the issue you can do I am trying to optimize a function which involves a gamma function. my data is a censored data. The error, that I am having is: "Error in fn(par, ...) : attempt to apply non-function" the R code is: , In
code :
``````d*log(w2-theta[3](n-d2))- D*log(w1+theta[3](n-d2))
``````
``````d*log(w2-theta[3]*(n-d2))- D*log(w1+theta[3]*(n-d2))
``````

## Equation of rbfKernel in kernlab is different from the standard?

By : Mark Howes
Date : March 29 2020, 07:55 AM
I think the issue was by ths following , I came across that discrepancy too and I wound up digging into the source to figure out if there was a typo in the documentation or what was going on exactly since sigma in the context of Gaussians traditionally goes as the standard deviation in the denominator right?
Here's the relevant source
code :
``````**kernlab\R\kernels.R**
## Define the kernel objects,
## functions with an additional slot for the kernel parameter list.
## kernel functions take two vector arguments and return a scalar (dot product)

rbfdot<- function(sigma=1)
{

rval <- function(x,y=NULL)
{
if(!is(x,"vector")) stop("x must be a vector")
if(!is(y,"vector")&&!is.null(y)) stop("y must a vector")
if (is(x,"vector") && is.null(y)){
return(1)
}
if (is(x,"vector") && is(y,"vector")){
if (!length(x)==length(y))
stop("number of dimension must be the same on both data points")
return(exp(sigma*(2*crossprod(x,y) - crossprod(x) - crossprod(y))))
# sigma/2 or sigma ??
}
}
return(new("rbfkernel",.Data=rval,kpar=list(sigma=sigma)))
}
``````

## Get random gamma distribution in tensorflow like numpy.random.gamma

Date : March 29 2020, 07:55 AM
around this issue You are setting different shape parameters in your distribution, so it is expected that they differ.
One thing to watch out for is that numpy has a "scale" parameter while TF has an "inverse scale" parameter. So one has to be inverted to get the same distribution.
code :
``````%matplotlib inline
import tensorflow as tf
import numpy as np
import matplotlib.pyplot as plt

size = (50000,)
shape_parameter = 1.5
scale_parameter = 0.5
bins = np.linspace(-1, 5, 30)

np_res = np.random.gamma(shape=shape_parameter, scale=scale_parameter, size=size)

# Note the 1/scale_parameter here

tf_op = tf.random_gamma(shape=size, alpha=shape_parameter, beta=1/scale_parameter)
with tf.Session() as sess:
tf_res = sess.run(tf_op)

plt.hist(tf_res, bins=bins, alpha=0.5);
plt.hist(np_res, bins=bins, alpha=0.5);
``````