1

Welcome to my GitHub

https://github.com/zq2599/blog_demos

Content: Classification and summary of all original articles and supporting source code, involving Java, Docker, Kubernetes, DevOPS, etc.;

About DL4J

  • DL4J is the abbreviation of Deeplearning4j. It is a deep learning framework based on Java virtual machine. It is developed with java and scala and has been open sourced. Official website: https://deeplearning4j.org/

About the "DL4J Actual Combat" series

  • "DL4J Actual Combat" is Xinchen’s original in the field of deep learning. It aims to understand the basic knowledge of deep learning from the shallower to the deeper through a series of hands-on operations, master general operations, and gradually become proficient in DL4J, and then solve the practical problems in learning and work. problem

Overview of this article

  • As the beginning of the "DL4J Actual Combat" series, this article prepares for the following articles and actual combat, including the following:
  • Determine environment and version information
  • Create a maven project named <font color="blue">dl4j-tutorials</font> as the parent project, and the entire series of codes later are sub-projects of dl4j-tutorial
  • Create a subproject named <font color="blue">commons</font>, which contains some commonly used tool codes, such as downloading data sets, drawings, etc.

Source download

nameLinkRemark
Project homepagehttps://github.com/zq2599/blog_demosThe project's homepage on GitHub
git warehouse address (https)https://github.com/zq2599/blog_demos.gitThe warehouse address of the source code of the project, https protocol
git warehouse address (ssh)git@github.com:zq2599/blog_demos.gitThe warehouse address of the source code of the project, ssh protocol
  • There are multiple folders in this git project. The source code of the "DL4J Actual Combat" series is under the <font color="blue">dl4j-tutorials</font> folder, as shown in the red box below:

在这里插入图片描述

Version Information

This series of actual combat is conducted in the following environment, which is listed here for your reference:

  1. Operating System: win10 64-bit Professional Edition
  2. JDK:1.8.0_281
  3. maven:3.6.2
  4. IEDA:2021.1.1 (Ultimate Edition)
  5. DL4J:1.0.0-beta7

"DL4J Actual Combat" series source code public parent project

  • The source code of the "DL4J Actual Combat" series are all placed under the same parent project. In addition to the convenience of code management, you can also manage the dependent library versions of each subproject in a unified manner, and then create this parent project;
  • Create a new maven project named <font color="blue">dl4j-tutorials</font>. There is only pom.xml under this project, and the content is as follows:
<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0"
         xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
         xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
    <modelVersion>4.0.0</modelVersion>
    <groupId>com.bolingcavalry</groupId>
    <artifactId>dlfj-tutorials</artifactId>
    <version>1.0-SNAPSHOT</version>
    <modules>
        <module>commons</module>
        <module>classifier-iris</module>
    </modules>
    <packaging>pom</packaging>

    <properties>
        <java.version>1.8</java.version>
        <maven.compiler.source>8</maven.compiler.source>
        <maven.compiler.target>8</maven.compiler.target>

        <dl4j-master.version>1.0.0-beta7</dl4j-master.version>
        <!-- Change the nd4j.backend property to nd4j-cuda-X-platform to use CUDA GPUs -->
        <!-- <nd4j.backend>nd4j-cuda-10.2-platform</nd4j.backend> -->
        <nd4j.backend>nd4j-native</nd4j.backend>
        <java.version>1.8</java.version>
        <maven-compiler-plugin.version>3.6.1</maven-compiler-plugin.version>
        <maven.minimum.version>3.3.1</maven.minimum.version>
        <exec-maven-plugin.version>1.4.0</exec-maven-plugin.version>
        <maven-shade-plugin.version>2.4.3</maven-shade-plugin.version>
        <jcommon.version>1.0.23</jcommon.version>
        <jfreechart.version>1.0.13</jfreechart.version>
        <logback.version>1.1.7</logback.version>
        <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
    </properties>
    
    <dependencyManagement>
        <dependencies>
            <dependency>
                <groupId>org.freemarker</groupId>
                <artifactId>freemarker</artifactId>
                <version>2.3.29</version>
            </dependency>
            <dependency>
                <groupId>io.netty</groupId>
                <artifactId>netty-common</artifactId>
                <version>4.1.48.Final</version>
            </dependency>
            <dependency>
                <groupId>org.nd4j</groupId>
                <artifactId>${nd4j.backend}</artifactId>
                <version>${dl4j-master.version}</version>
            </dependency>
            <dependency>
                <groupId>org.datavec</groupId>
                <artifactId>datavec-api</artifactId>
                <version>${dl4j-master.version}</version>
            </dependency>
            <dependency>
                <groupId>org.datavec</groupId>
                <artifactId>datavec-data-image</artifactId>
                <version>${dl4j-master.version}</version>
            </dependency>
            <dependency>
                <groupId>org.datavec</groupId>
                <artifactId>datavec-local</artifactId>
                <version>${dl4j-master.version}</version>
            </dependency>
            <dependency>
                <groupId>org.deeplearning4j</groupId>
                <artifactId>deeplearning4j-datasets</artifactId>
                <version>${dl4j-master.version}</version>
            </dependency>
            <dependency>
                <groupId>org.deeplearning4j</groupId>
                <artifactId>deeplearning4j-core</artifactId>
                <version>${dl4j-master.version}</version>
            </dependency>
            <dependency>
                <groupId>org.deeplearning4j</groupId>
                <artifactId>deeplearning4j-ui</artifactId>
                <version>${dl4j-master.version}</version>
            </dependency>
            <dependency>
                <groupId>org.deeplearning4j</groupId>
                <artifactId>deeplearning4j-zoo</artifactId>
                <version>${dl4j-master.version}</version>
            </dependency>
            <!-- ParallelWrapper & ParallelInference live here -->
            <dependency>
                <groupId>org.deeplearning4j</groupId>
                <artifactId>deeplearning4j-parallel-wrapper</artifactId>
                <version>${dl4j-master.version}</version>
            </dependency>
            <!-- Used in the feedforward/classification/MLP* and feedforward/regression/RegressionMathFunctions example -->
            <dependency>
                <groupId>jfree</groupId>
                <artifactId>jfreechart</artifactId>
                <version>${jfreechart.version}</version>
            </dependency>
            <dependency>
                <groupId>org.jfree</groupId>
                <artifactId>jcommon</artifactId>
                <version>${jcommon.version}</version>
            </dependency>
            <!-- Used for downloading data in some of the examples -->
            <dependency>
                <groupId>org.apache.httpcomponents</groupId>
                <artifactId>httpclient</artifactId>
                <version>4.3.5</version>
            </dependency>
            <dependency>
                <groupId>ch.qos.logback</groupId>
                <artifactId>logback-classic</artifactId>
                <version>${logback.version}</version>
            </dependency>
            <dependency>
                <groupId>org.datavec</groupId>
                <artifactId>datavec-data-codec</artifactId>
                <version>${dl4j-master.version}</version>
            </dependency>
            <dependency>
                <groupId>org.bytedeco</groupId>
                <artifactId>javacv-platform</artifactId>
                <version>1.5.2</version>
            </dependency>

            <dependency>
                <groupId>org.projectlombok</groupId>
                <artifactId>lombok</artifactId>
                <version>1.16.16</version>
            </dependency>
        </dependencies>
    </dependencyManagement>
</project>

Sub-project commons

  • In the following actual combat, we often use functions such as downloading files and drawing, so we add a new sub-project, and the tools corresponding to the functions of downloading drawing are all used in this for other projects.
  • Add a sub-project named <font color="blue">commons</font> under <font color="blue">dl4j-tutorials</font>, and its pom.xml content is as follows:
<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0"
         xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
         xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
    <parent>
        <artifactId>dlfj-tutorials</artifactId>
        <groupId>com.bolingcavalry</groupId>
        <version>1.0-SNAPSHOT</version>
    </parent>
    <modelVersion>4.0.0</modelVersion>
    <artifactId>commons</artifactId>
    <dependencies>
        <dependency>
            <groupId>org.datavec</groupId>
            <artifactId>datavec-api</artifactId>
        </dependency>
        <dependency>
            <groupId>org.apache.httpcomponents</groupId>
            <artifactId>httpclient</artifactId>
        </dependency>
        <dependency>
            <groupId>org.deeplearning4j</groupId>
            <artifactId>deeplearning4j-core</artifactId>
        </dependency>
        <dependency>
            <groupId>jfree</groupId>
            <artifactId>jfreechart</artifactId>
        </dependency>
    </dependencies>
</project>
  • At present, there are four categories in the commons sub-project, which are not original by Xinchen, but from the official demo of DL4J. The function introduction is as follows:
  • DataUtilities: Download and decompress the file corresponding to the specified address
  • DownloaderUtility: DL4J has prepared a rich data set for us (such as 150 iris data with tags), which are stored in the cloud (AZURE), and these data sets can be easily downloaded and decompressed through DownloaderUtility
  • PlotUtil: draw two-dimensional graphics
  • VAEPlotUtil: draw variational self-encoding graphs
  • The positions of the above four classes in the project are shown in the following figure. Due to space limitations, the code will not be posted. If necessary, please get it on github:

在这里插入图片描述

  • At this point, the preparatory work is complete, and the next journey will be very exciting, Xin Chen thank you for your company along the way!

You are not alone, Xinchen and original are with you all the way

  1. Java series
  2. Spring series
  3. Docker series
  4. kubernetes series
  5. Database + Middleware Series
  6. DevOps series

Welcome to pay attention to the public account: programmer Xin Chen

Search "Programmer Xin Chen" on WeChat, I am Xin Chen, and I look forward to traveling the Java world with you...
https://github.com/zq2599/blog_demos

程序员欣宸
147 声望24 粉丝

热爱Java和Docker