Class DL4JResources
- java.lang.Object
-
- org.deeplearning4j.common.resources.DL4JResources
-
public class DL4JResources extends Object
-
-
Field Summary
Fields Modifier and Type Field Description static StringDL4J_BASE_URL_PROPERTYDeprecated.static StringDL4J_RESOURCES_DIR_PROPERTYDeprecated.
-
Constructor Summary
Constructors Constructor Description DL4JResources()
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static FilegetBaseDirectory()static StringgetBaseDownloadURL()static FilegetDirectory(ResourceType resourceType, String resourceName)Get the storage location for the specified resource type and resource namestatic URLgetURL(String relativeToBase)Get the URL relative to the base URL.
For example, if baseURL is "https://dl4jdata.blob.core.windows.net/", and relativeToBase is "/datasets/iris.dat" this simply returns "https://dl4jdata.blob.core.windows.net/datasets/iris.dat"static StringgetURLString(String relativeToBase)Get the URL relative to the base URL as a String.
For example, if baseURL is "https://dl4jdata.blob.core.windows.net/", and relativeToBase is "/datasets/iris.dat" this simply returns "https://dl4jdata.blob.core.windows.net/datasets/iris.dat"static voidresetBaseDirectoryLocation()Reset to the default directory, or the directory set via theDL4JSystemProperties.DL4J_RESOURCES_DIR_PROPERTYsystem property, org.deeplearning4j.resources.directorystatic voidsetBaseDirectory(@NonNull File f)Set the base directory for local storage of files.static voidsetBaseDownloadURL(@NonNull String baseDownloadURL)Set the base download URL for (most) DL4J datasets and models.
This usually doesn't need to be set manually unless there is some issue with the default location
-
-
-
Field Detail
-
DL4J_RESOURCES_DIR_PROPERTY
@Deprecated public static final String DL4J_RESOURCES_DIR_PROPERTY
Deprecated.- See Also:
- Constant Field Values
-
DL4J_BASE_URL_PROPERTY
@Deprecated public static final String DL4J_BASE_URL_PROPERTY
Deprecated.- See Also:
- Constant Field Values
-
-
Method Detail
-
setBaseDownloadURL
public static void setBaseDownloadURL(@NonNull @NonNull String baseDownloadURL)Set the base download URL for (most) DL4J datasets and models.
This usually doesn't need to be set manually unless there is some issue with the default location- Parameters:
baseDownloadURL- Base download URL to set. For example, https://dl4jdata.blob.core.windows.net/
-
getBaseDownloadURL
public static String getBaseDownloadURL()
- Returns:
- The base URL hosting DL4J datasets and models
-
getURL
public static URL getURL(String relativeToBase) throws MalformedURLException
Get the URL relative to the base URL.
For example, if baseURL is "https://dl4jdata.blob.core.windows.net/", and relativeToBase is "/datasets/iris.dat" this simply returns "https://dl4jdata.blob.core.windows.net/datasets/iris.dat"- Parameters:
relativeToBase- Relative URL- Returns:
- URL
- Throws:
MalformedURLException- For bad URL
-
getURLString
public static String getURLString(String relativeToBase)
Get the URL relative to the base URL as a String.
For example, if baseURL is "https://dl4jdata.blob.core.windows.net/", and relativeToBase is "/datasets/iris.dat" this simply returns "https://dl4jdata.blob.core.windows.net/datasets/iris.dat"- Parameters:
relativeToBase- Relative URL- Returns:
- URL
- Throws:
MalformedURLException- For bad URL
-
resetBaseDirectoryLocation
public static void resetBaseDirectoryLocation()
Reset to the default directory, or the directory set via theDL4JSystemProperties.DL4J_RESOURCES_DIR_PROPERTYsystem property, org.deeplearning4j.resources.directory
-
setBaseDirectory
public static void setBaseDirectory(@NonNull @NonNull File f)Set the base directory for local storage of files. Default is:new File(System.getProperty("user.home"), ".deeplearning4j")- Parameters:
f- Base directory to use for resources
-
getBaseDirectory
public static File getBaseDirectory()
- Returns:
- The base storage directory for DL4J resources
-
getDirectory
public static File getDirectory(ResourceType resourceType, String resourceName)
Get the storage location for the specified resource type and resource name- Parameters:
resourceType- Type of resourceresourceName- Name of the resource- Returns:
- The root directory. Creates the directory and any parent directories, if required
-
-