alvinalexander.com | career | drupal | java | mac | mysql | perl | scala | uml | unix  

Java example source code file (dl4j)

This example Java source code file (dl4j) is included in the alvinalexander.com "Java Source Code Warehouse" project. The intent of this project is to help you "Learn Java by Example" TM.

Learn more about this Java project at its project page.

Java - Java tags/keywords

bash_source, cannot, classpath, command, dir, find, libraries, main, nd4j_backend, todo, using

The dl4j Java example source code

#!/bin/sh

set -e

if [ -z "${ND4J_BACKEND}" ];
    then export ND4J_BACKEND="x86" &&  echo "USING BACKEND $ND4J_BACKEND";
    #TODO: set the classpath according; need the backends to do this
fi

# if no classpath provided first look for default rpm install dir
if [ -z "$CLASSPATH" ]; then
    test -d "/usr/local/lib/deeplearning4j" && CLASSPATH="/usr/local/lib/deeplearning4j/*:"
fi

# then look for ../lib dir
if [ -z "$CLASSPATH" ]; then
    DIR=`cd $(dirname "${BASH_SOURCE[0]}") && pwd`
    test -d "$DIR/../lib" && CLASSPATH="`cd $DIR/../lib && pwd`/*:"
fi

CLASSPATH=${CLASSPATH:?"CANNOT FIND LIBRARIES"}

MAIN="org.deeplearning4j.cli.driver.CommandLineInterfaceDriver"

# echo the command so that people can see what is going on
COMMAND="java -cp $CLASSPATH $MAIN $*"
echo $COMMAND
exec $COMMAND

Other Java examples (source code examples)

Here is a short list of links related to this Java dl4j source code file:

... this post is sponsored by my books ...

#1 New Release!

FP Best Seller

 

new blog posts

 

Copyright 1998-2024 Alvin Alexander, alvinalexander.com
All Rights Reserved.

A percentage of advertising revenue from
pages under the /java/jwarehouse URI on this website is
paid back to open source projects.