This file contains 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 characters
package org.deeplearning4j.models.featuredetectors.rbm; | |
import static org.junit.Assert.*; | |
import org.deeplearning4j.linalg.api.ndarray.INDArray; | |
import org.deeplearning4j.linalg.factory.NDArrays; | |
import org.deeplearning4j.linalg.lossfunctions.LossFunctions; | |
import org.deeplearning4j.nn.api.Model; | |
import org.deeplearning4j.nn.conf.NeuralNetConfiguration; | |
import org.junit.Test; |
This file contains 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 characters
SentenceIterator iter = new FileSentenceIterator(new SentencePreProcessor() { | |
@Override | |
public String preProcess(String sentence) { | |
return new InputHomogenization(sentence).transform(); | |
} | |
},file); | |
TokenizerFactory t = new UimaTokenizerFactory(); |
This file contains 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 characters
/** | |
* Creates a tokenization,/stemming pipeline | |
* @return a tokenization/stemming pipeline | |
*/ | |
public static AnalysisEngine defaultAnalysisEngine() { | |
try { | |
return AnalysisEngineFactory.createEngine(AnalysisEngineFactory.createEngineDescription( | |
SentenceAnnotator.getDescription(), | |
TokenizerAnnotator.getDescription())); | |
}catch(Exception e) { |
This file contains 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 characters
package org.deeplearning4j.linalg.jcublas; | |
import jcuda.Pointer; | |
import jcuda.Sizeof; | |
import jcuda.cuDoubleComplex; | |
import jcuda.cuComplex; | |
import jcuda.jcublas.JCublas; | |
import org.deeplearning4j.linalg.api.complex.IComplexDouble; | |
import org.deeplearning4j.linalg.api.ndarray.INDArray; | |
import org.deeplearning4j.linalg.jcublas.complex.ComplexDouble; |
This file contains 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 characters
package org.deeplearning4j.linalg.jcublas; | |
import jcuda.Pointer; | |
import jcuda.Sizeof; | |
import jcuda.cuDoubleComplex; | |
import jcuda.cuComplex; | |
import jcuda.jcublas.JCublas; | |
import org.deeplearning4j.linalg.api.complex.IComplexDouble; | |
import org.deeplearning4j.linalg.api.complex.IComplexNDArray; | |
import org.deeplearning4j.linalg.api.ndarray.INDArray; |
This file contains 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 characters
package org.deeplearning4j.linalg.jcublas; | |
/** | |
* Created by mjk on 8/23/14. | |
* | |
* @author mjk | |
* @author Adam Gibson | |
*/ | |
This file contains 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 characters
public static INDArray gemv(INDArray A, INDArray B, INDArray C, float alpha, float beta) { | |
JCublasNDArray cA = (JCublasNDArray) A; | |
JCublasNDArray cB = (JCublasNDArray) B; | |
JCublasNDArray cC = (JCublasNDArray) C; | |
char trans = 'n'; | |
if (A.rows() == B.columns()) { | |
trans = 'T'; |
This file contains 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 characters
public static IComplexNDArray gemm(IComplexNDArray A, IComplexNDArray B, IComplexNDArray C, | |
float Alpha, float Beta) { | |
JCublasNDArray cA = (JCublasNDArray) A; | |
JCublasNDArray cB = (JCublasNDArray) B; | |
JCublasNDArray cC = (JCublasNDArray) C; | |
This file contains 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 characters
package org.deeplearning4j.linalg.jcublas; | |
import jcuda.Pointer; | |
import jcuda.Sizeof; | |
import jcuda.cuComplex; | |
import jcuda.cuDoubleComplex; | |
import jcuda.jcublas.JCublas; | |
import org.deeplearning4j.linalg.api.complex.IComplexDouble; | |
import org.deeplearning4j.linalg.api.complex.IComplexFloat; | |
import org.deeplearning4j.linalg.api.complex.IComplexNDArray; |
This file contains 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 characters
$.fn.serializeObject = function() | |
{ | |
var o = {}; | |
var a = this.serializeArray(); | |
$.each(a, function() { | |
if (o[this.name] !== undefined) { | |
if (!o[this.name].push) { | |
o[this.name] = [o[this.name]]; |