日韩性视频-久久久蜜桃-www中文字幕-在线中文字幕av-亚洲欧美一区二区三区四区-撸久久-香蕉视频一区-久久无码精品丰满人妻-国产高潮av-激情福利社-日韩av网址大全-国产精品久久999-日本五十路在线-性欧美在线-久久99精品波多结衣一区-男女午夜免费视频-黑人极品ⅴideos精品欧美棵-人人妻人人澡人人爽精品欧美一区-日韩一区在线看-欧美a级在线免费观看

歡迎訪問 生活随笔!

生活随笔

當(dāng)前位置: 首頁 > 人工智能 > pytorch >内容正文

pytorch

java深度学习(一)Maven创建一个新的ND4J工程

發(fā)布時間:2024/1/23 pytorch 30 豆豆
生活随笔 收集整理的這篇文章主要介紹了 java深度学习(一)Maven创建一个新的ND4J工程 小編覺得挺不錯的,現(xiàn)在分享給大家,幫大家做個參考.

Starting a New ND4J Project

To create a new ND4J project within IntelliJ, either click on “Open Project” on IntelliJ’s opening screen, or click on the File/Open tab, and choose “nd4j.” If you have cloned the source files from Github, the directory should be available from IntelliJ.

To create a new ND4J project within IntelliJ, just put the right dependencies in your project’s POM.xml file. With those in place, Maven will be able to build ND4J for you. Pasting the right dependencies into your POM amounts to installing ND4J – no other install is necessary.

Select maven-archetype-quickstart.

The images below will walk you through the windows of the IntelliJ New Project Wizard using Maven. First, name your group and artifact as you please.

Click through the following screen with “Next”, and on the screen after that, name your project (“ND4J-test”, for example) and hit finish. Now go into your POM.xml file within the root of the new ND4J project in IntelliJ.

Update the POM file with the dependences you’ll need. These will vary depending on whether you’re running on CPUs or GPUs.

The default backend for CPUs is nd4j-native-platform, and for CUDA it isnd4j-cuda-7.5-platform. You can paste that into the<dependencies> ... </dependencies> section of your POM like this:

xml <dependency><groupId>org.nd4j</groupId><artifactId>nd4j-native-platform</artifactId><version>${nd4j.version}</version> </dependency>

ND4J’s version is a variable here. It will refer to another line higher in the POM, in the<properties> ... </properties> section, specifying the nd4j version and appearing similar to this:

xml <nd4j.version></nd4j.version>

The dl4j version and DataVec version are also .

Version `` or higher now includes all backends by default and binaries for all platforms are automatically pulled. It is recommended to not alter this behaviorespecially if you are building on one platform but deploying to another (OS X vs. Linux). However, you can also explicitly pull binaries only for the platforms you are using. Information on how to do this can be found on thedependencies page.


import org.nd4j.linalg.api.ndarray.INDArray; import org.nd4j.linalg.factory.Nd4j;/*** Created by ESRI on 2017/11/4.*/ public class Test1 {public static void main(String args[]){INDArray x = Nd4j.create(new double[]{1, 2, 3, 4, 5, 6}, new int[]{3, 2});System.out.println(x);} }
SLF4J: Failed to load class "org.slf4j.impl.StaticLoggerBinder". SLF4J: Defaulting to no-operation (NOP) logger implementation SLF4J: See http://www.slf4j.org/codes.html#StaticLoggerBinder for further details. -- org.jblas INFO Starting temp DLL cleanup task. [[1.00,2.00][3.00,4.00][5.00,6.00]]



參考:http://nd4j.org/getstarted

總結(jié)

以上是生活随笔為你收集整理的java深度学习(一)Maven创建一个新的ND4J工程的全部內(nèi)容,希望文章能夠幫你解決所遇到的問題。

如果覺得生活随笔網(wǎng)站內(nèi)容還不錯,歡迎將生活随笔推薦給好友。