2021-05-08 18:18:11 +03:00
|
|
|
<html>
|
|
|
|
<head>
|
|
|
|
<meta name="viewport" content="width=device-width, initial-scale=1" charset="UTF-8">
|
|
|
|
<title>kmath-nd4j</title>
|
2022-04-12 11:30:54 +03:00
|
|
|
</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/jetbrains-mono.css" rel="Stylesheet"><link href="../styles/main.css" rel="Stylesheet"><link href="../styles/prism.css" rel="Stylesheet"><link href="../styles/logo-styles.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" defer></script><script type="text/javascript" src="../scripts/prism.js" async></script><script>const storage = localStorage.getItem("dokka-dark-mode")
|
|
|
|
const savedDarkMode = storage ? JSON.parse(storage) : false
|
|
|
|
if(savedDarkMode === true){
|
|
|
|
document.getElementsByTagName("html")[0].classList.add("theme-dark")
|
|
|
|
}</script>
|
|
|
|
|
2021-05-08 18:18:11 +03:00
|
|
|
|
2022-04-12 11:30:54 +03:00
|
|
|
<div class="navigation-wrapper" id="navigation-wrapper">
|
|
|
|
<div id="leftToggler"><span class="icon-toggler"></span></div>
|
|
|
|
<div class="library-name"><a href="../index.html"><span>kmath</span></a></div>
|
|
|
|
<div></div>
|
|
|
|
<div class="pull-right d-flex"><button id="theme-toggle-button"><span id="theme-toggle"></span></button>
|
|
|
|
<div id="searchBar"></div>
|
|
|
|
</div>
|
|
|
|
</div>
|
2021-05-08 18:18:11 +03:00
|
|
|
<div id="container">
|
2022-04-12 11:30:54 +03:00
|
|
|
<div id="leftColumn">
|
2021-05-08 18:18:11 +03:00
|
|
|
<div id="sideMenu"></div>
|
|
|
|
</div>
|
|
|
|
<div id="main">
|
|
|
|
<div class="main-content" id="content" pageids="kmath-nd4j::////PointingToDeclaration//270562306">
|
2022-04-12 11:30:54 +03:00
|
|
|
<div class="breadcrumbs"></div>
|
2021-05-08 18:18:11 +03:00
|
|
|
<div class="cover ">
|
2022-04-12 11:30:54 +03:00
|
|
|
<h1 class="cover"><span><span>kmath-nd4j</span></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 class="lang-kotlin">space.kscience:kmath-nd4j:0.3.0</code>.</p><p class="paragraph"><strong>Gradle Groovy:</strong></p><div class="sample-container"><pre><code class="block lang-groovy" theme="idea">repositories {<br> maven { url 'https://repo.kotlin.link' }<br> mavenCentral()<br>}<br><br>dependencies {<br> implementation 'space.kscience:kmath-nd4j:0.3.0'<br>}</code></pre><span class="top-right-position"><span class="copy-icon"></span><div class="copy-popup-wrapper popup-to-left"><span class="copy-popup-icon"></span><span>Content copied to clipboard</span></div></span></div><p class="paragraph"><strong>Gradle Kotlin DSL:</strong></p><div class="sample-container"><pre><code class="block lang-kotlin" theme="idea">repositories {<br> maven("https://repo.kotlin.link")<br> mavenCentral()<br>}<br><br>dependencies {<br> implementation("space.kscience:kmath-nd4j:0.3.0")<br>}</code></pre><span class="top-right-position"><span class="copy-icon"></span><div class="copy-popup-wrapper popup-to-left"><span class="copy-popup-icon"></span><span>Content copied to clipboard</span></div></span></div><h2 class=""> Examples</h2><p class="paragraph">NDStructure wrapper for INDArray:</p><div class="sample-container"><pre><code class="block lang-kotlin" theme="idea">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</code></pre><span class="top-right-position"><span class="copy-icon"></span><div class="copy-popup-wrapper popup-to-left"><span class="copy-popup-icon"></span><span>Content copied to clipboard</span></div></span></div><p class="paragraph">Fast element-wise and in-place arithmetics for INDArray:</p><div class="sample-container"><pre><code class="block lang-kotlin" theme="idea">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]]</code></pre><span class="top-right-position"><span class="copy-icon"></span><div class="copy-popup-wrapper popup-to-left"><span class="copy-popup-icon"></span><span>Content copied to clipboard</span></div></span></div><p class="paragraph">Contributed by <a href="https://github.com/CommanderTvis">Iaroslav Postovalov</a>.</p></div></div>
|
2021-05-08 18:18:11 +03:00
|
|
|
</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 ">
|
2022-04-12 11:30:54 +03:00
|
|
|
<div class=""><span class="inline-flex">
|
|
|
|
<div><a href="space.kscience.kmath.nd4j/index.html">space.kscience.kmath.nd4j</a></div>
|
|
|
|
<span class="anchor-wrapper"><span class="anchor-icon" pointing-to="-1586276746%2FPackages%2F270562306"></span>
|
2021-05-08 18:18:11 +03:00
|
|
|
<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>
|
2022-04-12 11:30:54 +03:00
|
|
|
<div class="footer"><span class="go-to-top-icon"><a href="#content" id="go-to-top-link"></a></span><span>© 2022 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>
|
2021-05-08 18:18:11 +03:00
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
|
|
|
|
</body></html>
|
|
|
|
|
|
|
|
|