kmath/kmath-nd4j/index.html

50 lines
5.4 KiB
HTML

<html>
<head>
<meta name="viewport" content="width=device-width, initial-scale=1" charset="UTF-8">
<title>kmath-nd4j</title>
</head><body><link href="../images/logo-icon.svg" rel="icon" type="image/svg"><script>var pathToRoot = "../";</script><script type="text/javascript" src="../scripts/sourceset_dependencies.js" async></script><link href="../styles/style.css" rel="Stylesheet"><link href="../styles/logo-styles.css" rel="Stylesheet"><link href="../styles/jetbrains-mono.css" rel="Stylesheet"><link href="../styles/main.css" rel="Stylesheet"><script type="text/javascript" src="../scripts/clipboard.js" async></script><script type="text/javascript" src="../scripts/navigation-loader.js" async></script><script type="text/javascript" src="../scripts/platform-content-handler.js" async></script><script type="text/javascript" src="../scripts/main.js" async></script>
<div id="container">
<div id="leftColumn"><a href="../index.html">
<div id="logo"></div>
</a>
<div id="paneSearch"></div>
<div id="sideMenu"></div>
</div>
<div id="main">
<script type="text/javascript" src="../scripts/main.js"></script><div id="leftToggler"><span class="icon-toggler"></span></div>
<div class="main-content" id="content" pageids="kmath-nd4j::////PointingToDeclaration//270562306">
<div class="navigation-wrapper" id="navigation-wrapper">
<div class="breadcrumbs"><a href="index.html">kmath-nd4j</a></div>
<div class="pull-right d-flex">
<div id="searchBar"></div>
</div>
</div>
<div class="cover ">
<h1 class="cover"><span>kmath-nd4j</span></h1>
<div class="platform-hinted UnderCoverText" data-platform-hinted="data-platform-hinted"><div class="content sourceset-depenent-content" data-active="" data-togglable=":kmath-nd4j:dokkaHtmlPartial/main"><p class="paragraph">ND4J based implementations of KMath abstractions.</p><ul><li><p class="paragraph"># : NDStructure wrapper for INDArray</p></li><li><p class="paragraph"># : Rings over Nd4jArrayStructure of Int and Long</p></li><li><p class="paragraph"># : Fields over Nd4jArrayStructure of Float and Double</p></li></ul><h2 class=""> Artifact:</h2><p class="paragraph">The Maven coordinates of this project are <code>space.kscience:kmath-nd4j:0.3.0-dev-16</code>.</p><p class="paragraph">Gradle:</p><div class="sample-container"><code class="" theme="idea"><pre>repositories {<br> maven { url 'https://repo.kotlin.link' }<br> mavenCentral()<br>}<br><br>dependencies {<br> implementation 'space.kscience:kmath-nd4j:0.3.0-dev-16'<br>}</pre></code></div><p class="paragraph">Gradle Kotlin DSL:</p><div class="sample-container"><code class="" theme="idea"><pre>repositories {<br> maven("https://repo.kotlin.link")<br> mavenCentral()<br>}<br><br>dependencies {<br> implementation("space.kscience:kmath-nd4j:0.3.0-dev-16")<br>}</pre></code></div><h2 class=""> Examples</h2><p class="paragraph">NDStructure wrapper for INDArray:</p><div class="sample-container"><code class="" theme="idea"><pre>import org.nd4j.linalg.factory.*<br>import scientifik.kmath.nd4j.*<br>import scientifik.kmath.structures.*<br><br>val array = Nd4j.ones(2, 2).asDoubleStructure()<br>println(array[0, 0]) // 1.0<br>array[intArrayOf(0, 0)] = 24.0<br>println(array[0, 0]) // 24.0</pre></code></div><p class="paragraph">Fast element-wise and in-place arithmetics for INDArray:</p><div class="sample-container"><code class="" theme="idea"><pre>import org.nd4j.linalg.factory.*<br>import scientifik.kmath.nd4j.*<br>import scientifik.kmath.operations.*<br><br>val field = DoubleNd4jArrayField(intArrayOf(2, 2))<br>val array = Nd4j.rand(2, 2).asDoubleStructure()<br><br>val res = field {<br> (25.0 / array + 20) * 4<br>}<br><br>println(res.ndArray)<br>// [[ 250.6449, 428.5840], <br>// [ 269.7913, 202.2077]]</pre></code></div><p class="paragraph">Contributed by <a href="https://github.com/CommanderTvis">Iaroslav Postovalov</a>.</p></div></div>
</div>
<h2 class="">Packages</h2>
<div class="table"><a data-name="-1586276746%2FPackages%2F270562306" anchor-label="space.kscience.kmath.nd4j" id="-1586276746%2FPackages%2F270562306" data-filterable-set=":kmath-nd4j:dokkaHtmlPartial/main"></a>
<div class="table-row" data-filterable-current=":kmath-nd4j:dokkaHtmlPartial/main" data-filterable-set=":kmath-nd4j:dokkaHtmlPartial/main">
<div>
<div class="main-subrow ">
<div class=""><span class="inline-flex"><a href="space.kscience.kmath.nd4j/index.html">space.kscience.kmath.nd4j</a><span class="anchor-wrapper"><span class="anchor-icon" pointing-to="-1586276746%2FPackages%2F270562306"></span>
<div class="copy-popup-wrapper "><span class="copy-popup-icon"></span><span>Link copied to clipboard</span></div>
</span></span></div>
<div class="pull-right"></div>
</div>
<div></div>
</div>
</div>
</div>
</div>
<div class="footer"><span class="go-to-top-icon"><a href="#content"></a></span><span>© 2021 Copyright</span><span class="pull-right"><span>Generated by </span><a href="https://github.com/Kotlin/dokka"><span>dokka</span><span class="padded-icon"></span></a></span></div>
</div>
</div>
</body></html>