Created
          August 3, 2011 21:14 
        
      - 
      
- 
        Save micrypt/1123788 to your computer and use it in GitHub Desktop. 
Revisions
- 
        micrypt revised this gist Aug 3, 2011 . 1 changed file with 1 addition and 1 deletion.There are no files selected for viewingThis file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -5,7 +5,7 @@ def vecLength(implicit values: List[Double]) = pow(values.sum, .5) // Radial basis function def rbf(v1: List[Double], v2: List[Double], gamma:Int = 20) = { val dv = { for(i <- (0 to v1.length)) yield (v1(i)-v2(i)) }.toList val l = vecLength(dv) pow(E, (-gamma*l)) } 
- 
        micrypt revised this gist Aug 3, 2011 . 1 changed file with 3 additions and 1 deletion.There are no files selected for viewingThis file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -1,9 +1,11 @@ import scala.math.{E, pow} // Vector length def vecLength(implicit values: List[Double]) = pow(values.sum, .5) // Radial basis function def rbf(v1: List[Double], v2: List[Double], gamma:Int = 20) = { val dv = { for(i <- (1 to v1.length)) yield (v1(i)-v2(i)) }.toList val l = vecLength(dv) pow(E, (-gamma*l)) } 
- 
        micrypt created this gist Aug 3, 2011 .There are no files selected for viewingThis file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,9 @@ // Vector length def vecLength(implicit values: List[Double]) = pow(values.sum, .5) // Radial basis function def rbf(v1: List[Double], v2: List[Double], gamma:Int = 20) = { val dv = { for(i <- (1 to v1.length)) yield (v1(i)-v2(i)) }.toList val l = vecLength(dv) pow(scala.math.E, (-gamma*l)) }