diff --git a/arbiter/arbiter-ui/pom.xml b/arbiter/arbiter-ui/pom.xml index 56d1013bf..03a335ea8 100644 --- a/arbiter/arbiter-ui/pom.xml +++ b/arbiter/arbiter-ui/pom.xml @@ -26,78 +26,13 @@ 4.0.0 - arbiter-ui_2.11 + arbiter-ui arbiter-ui 1.8 - - - - - buildUiTemplates - - false - - - - - com.google.code.play2-maven-plugin - play2-maven-plugin - ${maven-play2-plugin.version} - - - - - GenerateTemplates - compile - - - - template-compile - - - - - - - - maven-resources-plugin - ${maven-resources-plugin.version} - - - CopyTemplates - compile - - copy-resources - - - ${basedir}/src/main/scala/org/deeplearning4j/arbiter/ui/views/html - - - ${basedir}/target/twirl/main/org/deeplearning4j/arbiter/ui/views/html - true - - - - - - - - - - test-nd4j-native @@ -115,10 +50,17 @@ org.deeplearning4j - deeplearning4j-ui_2.11 + deeplearning4j-ui ${dl4j.version} + + ch.qos.logback + logback-classic + test + ${logback.version} + + org.deeplearning4j arbiter-deeplearning4j @@ -134,72 +76,6 @@ - - - org.apache.maven.wagon - wagon-http - 2.9 - - - - - - - org.codehaus.mojo - build-helper-maven-plugin - ${maven-build-helper-plugin.version} - - - add-source - compile - - add-source - - - - src/main/scala - src/main/java - src/main/views - - - - - - - - net.alchim31.maven - scala-maven-plugin - ${maven-scala-plugin.version} - - - - compile - testCompile - - - - - ${scala.version} - - - - - com.google.code.sbt-compiler-maven-plugin - sbt-compiler-maven-plugin - ${sbt-compiler-maven-plugin.version} - - - - - org.apache.maven.plugins - maven-compiler-plugin - - 1.8 - 1.8 - - - - diff --git a/arbiter/arbiter-ui/src/main/java/org/deeplearning4j/arbiter/ui/data/BaseJavaPersistable.java b/arbiter/arbiter-ui/src/main/java/org/deeplearning4j/arbiter/ui/data/BaseJavaPersistable.java index 68660a32f..3b5264f0d 100644 --- a/arbiter/arbiter-ui/src/main/java/org/deeplearning4j/arbiter/ui/data/BaseJavaPersistable.java +++ b/arbiter/arbiter-ui/src/main/java/org/deeplearning4j/arbiter/ui/data/BaseJavaPersistable.java @@ -20,8 +20,6 @@ import lombok.AllArgsConstructor; import org.apache.commons.compress.utils.IOUtils; import org.deeplearning4j.api.storage.Persistable; import org.deeplearning4j.arbiter.ui.module.ArbiterModule; -import org.deeplearning4j.ui.stats.impl.java.JavaStatsInitializationReport; -import scala.annotation.meta.field; import java.io.*; import java.lang.reflect.Field; diff --git a/arbiter/arbiter-ui/src/main/java/org/deeplearning4j/arbiter/ui/module/ArbiterModule.java b/arbiter/arbiter-ui/src/main/java/org/deeplearning4j/arbiter/ui/module/ArbiterModule.java index a7558451d..2f6bfc434 100644 --- a/arbiter/arbiter-ui/src/main/java/org/deeplearning4j/arbiter/ui/module/ArbiterModule.java +++ b/arbiter/arbiter-ui/src/main/java/org/deeplearning4j/arbiter/ui/module/ArbiterModule.java @@ -1,5 +1,6 @@ /******************************************************************************* * Copyright (c) 2015-2018 Skymind, Inc. + * Copyright (c) 2019 Konduit K.K. * * This program and the accompanying materials are made available under the * terms of the Apache License, Version 2.0 which is available at @@ -16,6 +17,8 @@ package org.deeplearning4j.arbiter.ui.module; +import io.netty.handler.codec.http.HttpResponseStatus; +import io.vertx.ext.web.RoutingContext; import lombok.extern.slf4j.Slf4j; import org.deeplearning4j.api.storage.Persistable; import org.deeplearning4j.api.storage.StatsStorage; @@ -31,8 +34,8 @@ import org.deeplearning4j.arbiter.ui.UpdateStatus; import org.deeplearning4j.arbiter.ui.data.GlobalConfigPersistable; import org.deeplearning4j.arbiter.ui.data.ModelInfoPersistable; import org.deeplearning4j.arbiter.ui.misc.UIUtils; -import org.deeplearning4j.arbiter.ui.views.html.ArbiterUI; import org.deeplearning4j.arbiter.util.ObjectUtils; +import org.deeplearning4j.nn.conf.serde.JsonMappers; import org.deeplearning4j.ui.api.Component; import org.deeplearning4j.ui.api.*; import org.deeplearning4j.ui.components.chart.ChartLine; @@ -48,18 +51,15 @@ import org.deeplearning4j.ui.i18n.I18NResource; import org.joda.time.format.DateTimeFormat; import org.joda.time.format.DateTimeFormatter; import org.nd4j.linalg.primitives.Pair; -import play.libs.Json; -import play.mvc.Result; -import play.mvc.Results; +import org.nd4j.shade.jackson.core.JsonProcessingException; import java.awt.*; import java.text.DecimalFormat; -import java.util.*; import java.util.List; +import java.util.*; import java.util.concurrent.atomic.AtomicBoolean; import static org.deeplearning4j.arbiter.ui.misc.JsonMapper.asJson; -import static play.mvc.Results.ok; /** * A Deeplearning4j {@link UIModule}, for integration with DL4J's user interface @@ -73,8 +73,6 @@ public class ArbiterModule implements UIModule { private static final DateTimeFormatter TIME_FORMATTER = DateTimeFormat.forPattern("YYYY-MM-dd HH:mm ZZ"); public static final String ARBITER_UI_TYPE_ID = "ArbiterUI"; - private static final String JSON = "application/json"; - private AtomicBoolean loggedArbiterAddress = new AtomicBoolean(false); private Map knownSessionIDs = Collections.synchronizedMap(new LinkedHashMap<>()); private String currentSessionID; @@ -138,17 +136,18 @@ public class ArbiterModule implements UIModule { @Override public List getRoutes() { - Route r1 = new Route("/arbiter", HttpMethod.GET, FunctionType.Supplier, () -> Results.ok(ArbiterUI.apply())); - Route r3 = new Route("/arbiter/lastUpdate", HttpMethod.GET, FunctionType.Supplier, this::getLastUpdateTime); - Route r4 = new Route("/arbiter/lastUpdate/:ids", HttpMethod.GET, FunctionType.Function, this::getModelLastUpdateTimes); - Route r5 = new Route("/arbiter/candidateInfo/:id", HttpMethod.GET, FunctionType.Function, this::getCandidateInfo); - Route r6 = new Route("/arbiter/config", HttpMethod.GET, FunctionType.Supplier, this::getOptimizationConfig); - Route r7 = new Route("/arbiter/results", HttpMethod.GET, FunctionType.Supplier, this::getSummaryResults); - Route r8 = new Route("/arbiter/summary", HttpMethod.GET, FunctionType.Supplier, this::getSummaryStatus); + Route r1 = new Route("/arbiter", HttpMethod.GET, (path, rc) -> rc.response() + .putHeader("content-type", "text/html; charset=utf-8").sendFile("templates/ArbiterUI.html")); + Route r3 = new Route("/arbiter/lastUpdate", HttpMethod.GET, (path, rc) -> this.getLastUpdateTime(rc)); + Route r4 = new Route("/arbiter/lastUpdate/:ids", HttpMethod.GET, (path, rc) -> this.getModelLastUpdateTimes(path.get(0), rc)); + Route r5 = new Route("/arbiter/candidateInfo/:id", HttpMethod.GET, (path, rc) -> this.getCandidateInfo(path.get(0), rc)); + Route r6 = new Route("/arbiter/config", HttpMethod.GET, (path, rc) -> this.getOptimizationConfig(rc)); + Route r7 = new Route("/arbiter/results", HttpMethod.GET, (path, rc) -> this.getSummaryResults(rc)); + Route r8 = new Route("/arbiter/summary", HttpMethod.GET, (path, rc) -> this.getSummaryStatus(rc)); - Route r9a = new Route("/arbiter/sessions/all", HttpMethod.GET, FunctionType.Supplier, this::listSessions); - Route r9b = new Route("/arbiter/sessions/current", HttpMethod.GET, FunctionType.Supplier, this::currentSession); - Route r9c = new Route("/arbiter/sessions/set/:to", HttpMethod.GET, FunctionType.Function, this::setSession); + Route r9a = new Route("/arbiter/sessions/all", HttpMethod.GET, (path, rc) -> this.listSessions(rc)); + Route r9b = new Route("/arbiter/sessions/current", HttpMethod.GET, (path, rc) -> this.currentSession(rc)); + Route r9c = new Route("/arbiter/sessions/set/:to", HttpMethod.GET, (path, rc) -> this.setSession(path.get(0), rc)); return Arrays.asList(r1, r3, r4, r5, r6, r7, r8, r9a, r9b, r9c); } @@ -197,23 +196,27 @@ public class ArbiterModule implements UIModule { getDefaultSession(); } - private Result currentSession() { + private void currentSession(RoutingContext rc) { String sid = currentSessionID == null ? "" : currentSessionID; - return ok(asJson(sid)).as(JSON); + rc.response() + .putHeader("content-type", "application/json") + .end(asJson(sid)); } - private Result listSessions() { - return Results.ok(asJson(knownSessionIDs.keySet())).as(JSON); + private void listSessions(RoutingContext rc) { + rc.response() + .putHeader("content-type", "application/json") + .end(asJson(knownSessionIDs.keySet())); } - private Result setSession(String newSessionID) { + private void setSession(String newSessionID, RoutingContext rc) { log.debug("Arbiter UI: Set to session {}", newSessionID); if (knownSessionIDs.containsKey(newSessionID)) { currentSessionID = newSessionID; - return ok(); + rc.response().end(); } else { - return Results.badRequest("Unknown session ID: " + newSessionID); + rc.response().setStatusCode(HttpResponseStatus.BAD_REQUEST.code()).end("Unknown session ID: " + newSessionID); } } @@ -255,30 +258,39 @@ public class ArbiterModule implements UIModule { } /** - * @return Last update time for the page + * Return the last update time for the page */ - private Result getLastUpdateTime(){ + private void getLastUpdateTime(RoutingContext rc){ //TODO - this forces updates on every request... which is fine, just inefficient long t = System.currentTimeMillis(); UpdateStatus us = new UpdateStatus(t, t, t); - return ok(Json.toJson(us)); + rc.response().putHeader("content-type", "application/json").end(asJson(us)); + } + + private String asJson(Object o){ + try{ + return JsonMappers.getMapper().writeValueAsString(o); + } catch (JsonProcessingException e){ + throw new RuntimeException("Error converting object to JSON", e); + } } /** * Get the last update time for the specified model IDs * @param modelIDs Model IDs to get the update time for */ - private Result getModelLastUpdateTimes(String modelIDs){ - + private void getModelLastUpdateTimes(String modelIDs, RoutingContext rc){ if(currentSessionID == null){ - return ok(); + rc.response().end(); + return; } StatsStorage ss = knownSessionIDs.get(currentSessionID); if(ss == null){ log.debug("getModelLastUpdateTimes(): Session ID is unknown: {}", currentSessionID); - return ok("-1"); + rc.response().end("-1"); + return; } String[] split = modelIDs.split(","); @@ -292,7 +304,7 @@ public class ArbiterModule implements UIModule { } } - return ok(Json.toJson(lastUpdateTimes)); + rc.response().putHeader("content-type", "application/json").end(asJson(lastUpdateTimes)); } /** @@ -301,12 +313,13 @@ public class ArbiterModule implements UIModule { * @param candidateId ID for the candidate * @return Content/info for the candidate */ - private Result getCandidateInfo(String candidateId){ + private void getCandidateInfo(String candidateId, RoutingContext rc){ StatsStorage ss = knownSessionIDs.get(currentSessionID); if(ss == null){ log.debug("getModelLastUpdateTimes(): Session ID is unknown: {}", currentSessionID); - return ok(); + rc.response().end(); + return; } GlobalConfigPersistable gcp = (GlobalConfigPersistable)ss.getStaticInfo(currentSessionID, ARBITER_UI_TYPE_ID, GlobalConfigPersistable.GLOBAL_WORKER_ID);; @@ -316,7 +329,10 @@ public class ArbiterModule implements UIModule { if(p == null){ String title = "No results found for model " + candidateId + "."; ComponentText ct = new ComponentText.Builder(title,STYLE_TEXT_SZ12).build(); - return ok(asJson(ct)).as(JSON); + rc.response() + .putHeader("content-type", "application/json") + .end(asJson(ct)); + return; } ModelInfoPersistable mip = (ModelInfoPersistable)p; @@ -474,25 +490,27 @@ public class ArbiterModule implements UIModule { ComponentDiv cd = new ComponentDiv(STYLE_DIV_WIDTH_100_PC, components); - return ok(asJson(cd)).as(JSON); + rc.response().putHeader("content-type", "application/json").end(asJson(cd)); } /** * Get the optimization configuration - second section in the page */ - private Result getOptimizationConfig(){ + private void getOptimizationConfig(RoutingContext rc){ StatsStorage ss = knownSessionIDs.get(currentSessionID); if(ss == null){ log.debug("getOptimizationConfig(): Session ID is unknown: {}", currentSessionID); - return ok(); + rc.response().end(); + return; } Persistable p = ss.getStaticInfo(currentSessionID, ARBITER_UI_TYPE_ID, GlobalConfigPersistable.GLOBAL_WORKER_ID); if(p == null){ - log.info("No static info"); - return ok(); + log.debug("No static info"); + rc.response().end(); + return; } List components = new ArrayList<>(); @@ -574,14 +592,15 @@ public class ArbiterModule implements UIModule { ComponentDiv cd = new ComponentDiv(STYLE_DIV_WIDTH_100_PC, components); - return ok(asJson(cd)).as(JSON); + rc.response().putHeader("content-type", "application/json").end(asJson(cd)); } - private Result getSummaryResults(){ + private void getSummaryResults(RoutingContext rc){ StatsStorage ss = knownSessionIDs.get(currentSessionID); if(ss == null){ log.debug("getSummaryResults(): Session ID is unknown: {}", currentSessionID); - return ok(); + rc.response().end(); + return; } List allModelInfoTemp = new ArrayList<>(ss.getLatestUpdateAllWorkers(currentSessionID, ARBITER_UI_TYPE_ID)); @@ -592,24 +611,26 @@ public class ArbiterModule implements UIModule { table.add(new String[]{mip.getModelIdx().toString(), score, mip.getStatus().toString()}); } - return ok(asJson(table)).as(JSON); + rc.response().putHeader("content-type", "application/json").end(asJson(table)); } /** * Get summary status information: first section in the page */ - private Result getSummaryStatus(){ + private void getSummaryStatus(RoutingContext rc){ StatsStorage ss = knownSessionIDs.get(currentSessionID); if(ss == null){ log.debug("getOptimizationConfig(): Session ID is unknown: {}", currentSessionID); - return ok(); + rc.response().end(); + return; } Persistable p = ss.getStaticInfo(currentSessionID, ARBITER_UI_TYPE_ID, GlobalConfigPersistable.GLOBAL_WORKER_ID); if(p == null){ log.info("No static info"); - return ok(); + rc.response().end(); + return; } GlobalConfigPersistable gcp = (GlobalConfigPersistable)p; @@ -711,7 +732,7 @@ public class ArbiterModule implements UIModule { ComponentDiv cd = new ComponentDiv(STYLE_DIV_WIDTH_100_PC, components); - return ok(asJson(cd)).as(JSON); + rc.response().putHeader("content-type", "application/json").end(asJson(cd)); } diff --git a/arbiter/arbiter-ui/src/main/views/org/deeplearning4j/arbiter/ui/views/ArbiterUI.scala.html b/arbiter/arbiter-ui/src/main/resources/templates/ArbiterUI.html similarity index 98% rename from arbiter/arbiter-ui/src/main/views/org/deeplearning4j/arbiter/ui/views/ArbiterUI.scala.html rename to arbiter/arbiter-ui/src/main/resources/templates/ArbiterUI.html index 372de64c5..9a5b6a998 100644 --- a/arbiter/arbiter-ui/src/main/views/org/deeplearning4j/arbiter/ui/views/ArbiterUI.scala.html +++ b/arbiter/arbiter-ui/src/main/resources/templates/ArbiterUI.html @@ -1,5 +1,6 @@ - - - - - DL4J - Arbiter UI - - - - - - - - - - - - - - - - - - - - -
-
Deeplearning4J - Arbiter UI
- -
- - -
-
-
-

Summary

-
-
-
-
- -
-
-

Optimization Settings

-
-
-
- - -
-
Results
-
- - - - - - -
-
-
- -
-
-

Selected Result

-
-
-
-
- -""")) - } - } - } - - def render(): play.twirl.api.HtmlFormat.Appendable = apply() - - def f:(() => play.twirl.api.HtmlFormat.Appendable) = () => apply() - - def ref: this.type = this - -} - - -} - -/**/ -object ArbiterUI extends ArbiterUI_Scope0.ArbiterUI - /* - -- GENERATED -- - DATE: Thu Sep 05 18:53:38 AEST 2019 - SOURCE: C:/DL4J/Git/deeplearning4j/arbiter/arbiter-ui/src/main/views/org/deeplearning4j/arbiter/ui/views/ArbiterUI.scala.html - HASH: aa565fc00b748d09bde27d54caef529f2933efbb - MATRIX: 647->0|1821->1146|1850->1147|1892->1161|2123->1365|2152->1366|2191->1378|2230->1389|2259->1390|2301->1404|2402->1478|2431->1479|2470->1491|2507->1500|2536->1501|2578->1515|2641->1551|2670->1552|2709->1564|2740->1567|2769->1568|2811->1582|3046->1790|3075->1791|3114->1803|3145->1806|3174->1807|3216->1821|3453->2031|3482->2032|3521->2044|3555->2050|3584->2051|3626->2065|3730->2142|3759->2143|3798->2155|3845->2174|3874->2175|3916->2189|4088->2334|4117->2335|4156->2347|4252->2415|4281->2416|4323->2430|4465->2545|4494->2546|4533->2558|4583->2580|4612->2581|4654->2595|4825->2739|4854->2740|4893->2752|4943->2774|4972->2775|5014->2789|5144->2892|5173->2893|5212->2905|5372->3037|5401->3038|5443->3052|5596->3178|5625->3179|5662->3189|5719->3218|5748->3219|5791->3233|6048->3462|6078->3463|6118->3475|6205->3533|6235->3534|6278->3548|6372->3614|6402->3615|6442->3627|6580->3736|6610->3737|6653->3751|6733->3803|6763->3804|6803->3816|6851->3835|6881->3836|6924->3850|7507->4405|7537->4406|7577->4418|7624->4436|7654->4437|7697->4451|7756->4482|7786->4483|7826->4495|7879->4519|7909->4520|7952->4534|8011->4565|8041->4566|8081->4578|8211->4678|8242->4679|8285->4693|8723->5103|8753->5104|8793->5116|8855->5149|8885->5150|8928->5164|9259->5467|9289->5468|9329->5480|9391->5513|9421->5514|9464->5528|9575->5611|9605->5612|9643->5622|9695->5645|9725->5646|9768->5660|9886->5750|9916->5751|9954->5761|9994->5772|10024->5773|10067->5787|10160->5852|10190->5853|10230->5865|11496->7102|11526->7103|11564->7113|11695->7215|11725->7216|11768->7230|12332->7765|12362->7766|12409->7784|12552->7898|12582->7899|12674->7962|12704->7963|12751->7981|12863->8064|12893->8065|12944->8087|13201->8315|13231->8316|13286->8342|13341->8368|13371->8369|13430->8399|13505->8445|13535->8446|13590->8472|13713->8566|13743->8567|13796->8591|13989->8755|14019->8756|14049->8758|14177->8857|14207->8858|14429->9051|14459->9052|14506->9070|14640->9175|14670->9176|14721->9198|15033->9481|15063->9482|15162->9552|15192->9553|15237->9569|15361->9664|15391->9665|15438->9683|15548->9764|15578->9765|15629->9787|15924->10053|15954->10054|16057->10128|16087->10129|16132->10145|16287->10271|16317->10272|16366->10292|16501->10398|16531->10399|16582->10421|16770->10580|16800->10581|16901->10653|16931->10654|16976->10670|17087->10752|17117->10753|17164->10771|17303->10881|17333->10882|17384->10904|17697->11188|17727->11189|17772->11205|17802->11206|17840->11216|17870->11217|17905->11224|17934->11225|17970->11233|18046->11280|18076->11281|18114->11291|18371->11519|18401->11520|18444->11534|18520->11582|18550->11583|18590->11595|18821->11797|18851->11798|18894->11812|19027->11916|19057->11917|19104->11935|19197->11999|19227->12000|19270->12014|19375->12091|19405->12092|19445->12104|19484->12114|19514->12115|19557->12129|19614->12157|19644->12158|19691->12176|19873->12329|19903->12330|19954->12352|20044->12413|20074->12414|20121->12432|20223->12505|20253->12506|20291->12516|20321->12517|20361->12529|20456->12596|20485->12597|20521->12605|20576->12631|20606->12632|20644->12642|22001->13970|22031->13971|22074->13985|22165->14047|22195->14048|22242->14066|22396->14191|22426->14192|22456->14193|22490->14198|22520->14199|22567->14217|22711->14332|22741->14333|22784->14347|23097->14632|23127->14633|23161->14639|23190->14640|23226->14648|23346->14739|23376->14740|23414->14750|23521->14829|23550->14830|23584->14836|23640->14863|23670->14864|23708->14874|23814->14951|23844->14952|23887->14966|23933->14983|23963->14984|24010->15002|24062->15025|24092->15026|24122->15027|24173->15049|24203->15050|24250->15068|24303->15092|24333->15093|24376->15107|24433->15136|24463->15137|24493->15138|24527->15143|24557->15144|24600->15158|24646->15175|24676->15176|24723->15194|24776->15218|24806->15219|24836->15220|24887->15242|24917->15243|24964->15261|25016->15284|25046->15285|25089->15299|25146->15328|25176->15329|25210->15335|25239->15336|25273->15342|25329->15369|25359->15370|25397->15380|25517->15471|25547->15472|25590->15486|25678->15546|25708->15547|25738->15548|25772->15553|25802->15554|25845->15568|25933->15628|25963->15629|25997->15635|26026->15636|26062->15644|26236->15789|26266->15790|26304->15800|26361->15828|26391->15829|26434->15843|26611->15992|26641->15993|26677->16001|26706->16002|26746->16014|26852->16091|26882->16092|26920->16102|27010->16163|27040->16164|27083->16178|27379->16445|27409->16446|27456->16464|27613->16592|27643->16593|27694->16615|27777->16669|27807->16670|27837->16671|27871->16676|27901->16677|27952->16699|28034->16752|28064->16753|28107->16767|28137->16768|28167->16769|28201->16774|28231->16775|28278->16793|28454->16940|28484->16941|28529->16957|28704->17104|28734->17105|28770->17113|28799->17114|28966->17252|28996->17253|29034->17263|29121->17321|29151->17322|29194->17336|29569->17682|29599->17683|29646->17701|29828->17854|29858->17855|29896->17865|29926->17866|29962->17874|29991->17875|30057->17912|30087->17913|30125->17923|30261->18030|30291->18031|30334->18045|30370->18052|30400->18053|30447->18071|30608->18203|30638->18204|30689->18226|30783->18291|30813->18292|30886->18336|30916->18337|30967->18359|31070->18433|31100->18434|31143->18448|31173->18449|31213->18461|31243->18462|31277->18468|31306->18469|31338->18473|31406->18512|31436->18513|31474->18523|31529->18549|31559->18550|31602->18564|31694->18628|31724->18629|31760->18637|31789->18638|31840->18660|31870->18661|31908->18671|31964->18698|31994->18699|32037->18713|32129->18777|32159->18778|32195->18786|32224->18787|32275->18809|32305->18810|32343->18820|32399->18847|32429->18848|32472->18862|32564->18926|32594->18927|32630->18935|32659->18936 - LINES: 25->1|51->27|51->27|52->28|58->34|58->34|60->36|60->36|60->36|61->37|64->40|64->40|66->42|66->42|66->42|67->43|68->44|68->44|70->46|70->46|70->46|71->47|77->53|77->53|79->55|79->55|79->55|80->56|86->62|86->62|88->64|88->64|88->64|89->65|91->67|91->67|93->69|93->69|93->69|94->70|98->74|98->74|100->76|100->76|100->76|101->77|103->79|103->79|105->81|105->81|105->81|106->82|110->86|110->86|112->88|112->88|112->88|113->89|116->92|116->92|118->94|119->95|119->95|120->96|122->98|122->98|123->99|123->99|123->99|124->100|129->105|129->105|131->107|132->108|132->108|133->109|135->111|135->111|137->113|138->114|138->114|139->115|140->116|140->116|142->118|142->118|142->118|143->119|159->135|159->135|161->137|161->137|161->137|162->138|163->139|163->139|165->141|165->141|165->141|166->142|167->143|167->143|169->145|169->145|169->145|170->146|178->154|178->154|180->156|180->156|180->156|181->157|187->163|187->163|189->165|190->166|190->166|191->167|194->170|194->170|195->171|195->171|195->171|196->172|199->175|199->175|200->176|200->176|200->176|201->177|203->179|203->179|205->181|234->210|234->210|235->211|236->212|236->212|237->213|246->222|246->222|247->223|249->225|249->225|251->227|251->227|252->228|254->230|254->230|255->231|261->237|261->237|262->238|262->238|262->238|263->239|264->240|264->240|265->241|266->242|266->242|268->244|270->246|270->246|271->247|272->248|272->248|277->253|277->253|278->254|279->255|279->255|280->256|286->262|286->262|289->265|289->265|291->267|292->268|292->268|293->269|294->270|294->270|295->271|302->278|302->278|305->281|305->281|307->283|308->284|308->284|310->286|311->287|311->287|312->288|315->291|315->291|318->294|318->294|320->296|321->297|321->297|322->298|323->299|323->299|324->300|331->307|331->307|332->308|332->308|333->309|333->309|334->310|334->310|336->312|336->312|336->312|337->313|343->319|343->319|344->320|345->321|345->321|347->323|350->326|350->326|351->327|353->329|353->329|354->330|355->331|355->331|356->332|358->334|358->334|360->336|360->336|360->336|361->337|361->337|361->337|362->338|365->341|365->341|366->342|367->343|367->343|368->344|370->346|370->346|371->347|371->347|373->349|375->351|375->351|377->353|377->353|377->353|378->354|403->379|403->379|404->380|405->381|405->381|406->382|408->384|408->384|408->384|408->384|408->384|409->385|411->387|411->387|412->388|417->393|417->393|418->394|418->394|420->396|421->397|421->397|422->398|423->399|423->399|424->400|424->400|424->400|425->401|426->402|426->402|427->403|427->403|427->403|428->404|429->405|429->405|429->405|429->405|429->405|430->406|431->407|431->407|432->408|433->409|433->409|433->409|433->409|433->409|434->410|434->410|434->410|435->411|436->412|436->412|436->412|436->412|436->412|437->413|438->414|438->414|439->415|440->416|440->416|441->417|441->417|442->418|442->418|442->418|443->419|444->420|444->420|445->421|446->422|446->422|446->422|446->422|446->422|447->423|448->424|448->424|449->425|449->425|451->427|452->428|452->428|453->429|453->429|453->429|454->430|457->433|457->433|458->434|458->434|462->438|463->439|463->439|464->440|464->440|464->440|465->441|468->444|468->444|469->445|470->446|470->446|471->447|472->448|472->448|472->448|472->448|472->448|473->449|474->450|474->450|475->451|475->451|475->451|475->451|475->451|476->452|479->455|479->455|481->457|486->462|486->462|487->463|487->463|490->466|490->466|491->467|491->467|491->467|492->468|497->473|497->473|498->474|503->479|503->479|504->480|504->480|505->481|505->481|507->483|507->483|508->484|511->487|511->487|512->488|512->488|512->488|513->489|515->491|515->491|516->492|517->493|517->493|518->494|518->494|519->495|521->497|521->497|522->498|522->498|523->499|523->499|524->500|524->500|526->502|528->504|528->504|529->505|529->505|529->505|530->506|532->508|532->508|533->509|533->509|534->510|534->510|535->511|535->511|535->511|536->512|538->514|538->514|539->515|539->515|540->516|540->516|541->517|541->517|541->517|542->518|544->520|544->520|545->521|545->521 - -- GENERATED -- - */ - \ No newline at end of file diff --git a/arbiter/arbiter-ui/src/test/java/org/deeplearning4j/arbiter/optimize/TestBasic.java b/arbiter/arbiter-ui/src/test/java/org/deeplearning4j/arbiter/optimize/TestBasic.java index aae674ab4..804c6f974 100644 --- a/arbiter/arbiter-ui/src/test/java/org/deeplearning4j/arbiter/optimize/TestBasic.java +++ b/arbiter/arbiter-ui/src/test/java/org/deeplearning4j/arbiter/optimize/TestBasic.java @@ -47,13 +47,13 @@ import org.deeplearning4j.arbiter.task.MultiLayerNetworkTaskCreator; import org.deeplearning4j.arbiter.ui.listener.ArbiterStatusListener; import org.deeplearning4j.datasets.iterator.EarlyTerminationDataSetIterator; import org.deeplearning4j.datasets.iterator.impl.MnistDataSetIterator; -import org.deeplearning4j.eval.Evaluation; import org.deeplearning4j.nn.conf.inputs.InputType; import org.deeplearning4j.nn.weights.WeightInit; import org.deeplearning4j.ui.api.UIServer; import org.deeplearning4j.ui.storage.InMemoryStatsStorage; import org.junit.Ignore; import org.junit.Test; +import org.nd4j.evaluation.classification.Evaluation; import org.nd4j.linalg.activations.Activation; import org.nd4j.linalg.api.buffer.DataType; import org.nd4j.linalg.dataset.api.iterator.DataSetIterator; diff --git a/deeplearning4j/deeplearning4j-common/src/main/java/org/deeplearning4j/config/DL4JSystemProperties.java b/deeplearning4j/deeplearning4j-common/src/main/java/org/deeplearning4j/config/DL4JSystemProperties.java index 04773ee74..4c4d2844f 100644 --- a/deeplearning4j/deeplearning4j-common/src/main/java/org/deeplearning4j/config/DL4JSystemProperties.java +++ b/deeplearning4j/deeplearning4j-common/src/main/java/org/deeplearning4j/config/DL4JSystemProperties.java @@ -71,7 +71,7 @@ public class DL4JSystemProperties { public static final String CRASH_DUMP_OUTPUT_DIRECTORY_PROPERTY = "org.deeplearning4j.crash.reporting.directory"; /** - * Applicability: deeplearning4j-ui_2.xx
+ * Applicability: deeplearning4j-ui
* Description: The DL4J training UI (StatsListener + UIServer.getInstance().attach(ss)) will subsample the number * of chart points when a lot of data is present - i.e., only a maximum number of points will be shown on each chart. * This is to reduce the UI bandwidth requirements and client-side rendering cost. @@ -81,7 +81,7 @@ public class DL4JSystemProperties { /** - * Applicability: deeplearning4j-play (deeplearning4j-ui_2.xx)
+ * Applicability: deeplearning4j-vertx (deeplearning4j-ui)
* Description: This property sets the port that the UI will be available on. Default port: 9000. * Set to 0 for a random port. */ diff --git a/deeplearning4j/deeplearning4j-nearestneighbors-parent/deeplearning4j-nearestneighbor-server/pom.xml b/deeplearning4j/deeplearning4j-nearestneighbors-parent/deeplearning4j-nearestneighbor-server/pom.xml index 38ee4204c..66c639f56 100644 --- a/deeplearning4j/deeplearning4j-nearestneighbors-parent/deeplearning4j-nearestneighbor-server/pom.xml +++ b/deeplearning4j/deeplearning4j-nearestneighbors-parent/deeplearning4j-nearestneighbor-server/pom.xml @@ -34,16 +34,6 @@ 2.11 - - - maven-compiler-plugin - - 1.8 - 1.8 - - - - @@ -56,9 +46,14 @@ *.java **/*.java - - ../../deeplearning4j-ui-parent/deeplearning4j-play/src/main/resources/application.conf - + + + + org.apache.maven.plugins + maven-compiler-plugin + + 1.8 + 1.8 diff --git a/deeplearning4j/deeplearning4j-nlp-parent/deeplearning4j-nlp-uima/pom.xml b/deeplearning4j/deeplearning4j-nlp-parent/deeplearning4j-nlp-uima/pom.xml index 44fbbcf9d..619d36db6 100644 --- a/deeplearning4j/deeplearning4j-nlp-parent/deeplearning4j-nlp-uima/pom.xml +++ b/deeplearning4j/deeplearning4j-nlp-parent/deeplearning4j-nlp-uima/pom.xml @@ -68,7 +68,7 @@ org.deeplearning4j - deeplearning4j-ui_2.11 + deeplearning4j-ui ${project.version} test diff --git a/deeplearning4j/deeplearning4j-scaleout/deeplearning4j-scaleout-parallelwrapper-parameter-server/pom.xml b/deeplearning4j/deeplearning4j-scaleout/deeplearning4j-scaleout-parallelwrapper-parameter-server/pom.xml index eaf0e6be8..f95b9935b 100644 --- a/deeplearning4j/deeplearning4j-scaleout/deeplearning4j-scaleout-parallelwrapper-parameter-server/pom.xml +++ b/deeplearning4j/deeplearning4j-scaleout/deeplearning4j-scaleout-parallelwrapper-parameter-server/pom.xml @@ -35,15 +35,18 @@ - - - maven-compiler-plugin - - 1.8 - 1.8 - - - + + + + org.apache.maven.plugins + maven-compiler-plugin + + 1.8 + 1.8 + + + + diff --git a/deeplearning4j/deeplearning4j-scaleout/deeplearning4j-scaleout-parallelwrapper/pom.xml b/deeplearning4j/deeplearning4j-scaleout/deeplearning4j-scaleout-parallelwrapper/pom.xml index e647445e9..e3b6444bf 100644 --- a/deeplearning4j/deeplearning4j-scaleout/deeplearning4j-scaleout-parallelwrapper/pom.xml +++ b/deeplearning4j/deeplearning4j-scaleout/deeplearning4j-scaleout-parallelwrapper/pom.xml @@ -28,16 +28,18 @@ deeplearning4j-parallel-wrapper - - - org.apache.maven.plugins - maven-compiler-plugin - - 1.8 - 1.8 - - - + + + + org.apache.maven.plugins + maven-compiler-plugin + + 1.8 + 1.8 + + + + UTF-8 @@ -84,7 +86,7 @@ org.deeplearning4j - deeplearning4j-play_2.11 + deeplearning4j-ui ${project.version} test diff --git a/deeplearning4j/deeplearning4j-scaleout/spark/dl4j-spark-parameterserver/pom.xml b/deeplearning4j/deeplearning4j-scaleout/spark/dl4j-spark-parameterserver/pom.xml index 9192bb877..f22f2f6b8 100644 --- a/deeplearning4j/deeplearning4j-scaleout/spark/dl4j-spark-parameterserver/pom.xml +++ b/deeplearning4j/deeplearning4j-scaleout/spark/dl4j-spark-parameterserver/pom.xml @@ -79,15 +79,18 @@ - - - maven-compiler-plugin - - 1.8 - 1.8 - - - + + + + org.apache.maven.plugins + maven-compiler-plugin + + 1.8 + 1.8 + + + + diff --git a/deeplearning4j/deeplearning4j-scaleout/spark/dl4j-spark/pom.xml b/deeplearning4j/deeplearning4j-scaleout/spark/dl4j-spark/pom.xml index 488229fa5..5cf290c31 100644 --- a/deeplearning4j/deeplearning4j-scaleout/spark/dl4j-spark/pom.xml +++ b/deeplearning4j/deeplearning4j-scaleout/spark/dl4j-spark/pom.xml @@ -67,16 +67,9 @@ org.deeplearning4j - deeplearning4j-play_2.11 + deeplearning4j-ui ${deeplearning4j.version} test - - - - net.jpountz.lz4 - lz4 - - diff --git a/deeplearning4j/deeplearning4j-ui-parent/deeplearning4j-play/.gitignore b/deeplearning4j/deeplearning4j-ui-parent/deeplearning4j-play/.gitignore deleted file mode 100644 index 2c1cc352a..000000000 --- a/deeplearning4j/deeplearning4j-ui-parent/deeplearning4j-play/.gitignore +++ /dev/null @@ -1,17 +0,0 @@ -logs -project/project -project/target -target -tmp -.history -dist -/.idea -/*.iml -/out -/.idea_modules -/.classpath -/.project -/RUNNING_PID -/.settings - - \ No newline at end of file diff --git a/deeplearning4j/deeplearning4j-ui-parent/deeplearning4j-play/developerReadme.md b/deeplearning4j/deeplearning4j-ui-parent/deeplearning4j-play/developerReadme.md deleted file mode 100644 index 47ae877b6..000000000 --- a/deeplearning4j/deeplearning4j-ui-parent/deeplearning4j-play/developerReadme.md +++ /dev/null @@ -1,88 +0,0 @@ - -# Deeplearning4j UI (deeplearning4j-play) Developer Readme - -The deeplearning4j UI utilizes an embedded Play server for hosting web pages. This guide documents some basic information -about the design, and how new pages can be added. - -## Overview - -As of DL4J 0.7.2, version 2.4 is utilized for scala 2.10 compatibility, which was dropped in Play 2.5 and later. -Due to DL4J being managed by Maven, not all features of Play (such as conf/routes approach to routing configuration, and -the default internationalization mechanism) are supported. - -Some key concepts: - -- The actual HTML pages are defined in the main/views/org.deeplearning4j.ui.views.* directory - - These views are based on Twirl template engine: in practice, templates are mostly HTML with a - little scala code mixed in - - The views themselves need to be rendered to a scala class (under main/scala). This is currently done manually, - see the 'building templates' section. -- Routing is somewhat non-standard in DL4J, compared to a typical Play application - - The DL4J has the concept of a 'UI module': a related set of pages to serve via the UI - - Each module implements the UIModule interface, which defines a set of routes, and how to handle page requests - - Custom modules are supported: this is not enabled by default. See PlayUIServer UI_CUSTOM_MODULE_PROPERTY for details. -- Internationalization (i.e., multiple languages) is supported, but not using the standard Play mechanisms -- The main class and entry point is PlayUIServer - -## Building Templates - -The current setup (using Maven + Play) means that the HTML templates need to be built manually. -Just run ```mvn compile -P buildUiTemplates``` on the command line to do this - this will generate the Scala classes -from all of the HTML files (in the views directory) and copy them to the appropriate location in the scala directory. - -## Adding New Pages - -Adding a new (built-in) page to the UI can be done using the following approach: - -- Define a new module in org.deeplearning4j.ui.module, that implements the UIModule interface - - Provide routes: these are the endpoints that the user will be able to query, and define what methods will be used - to get the result to return for that page. See for example TrainModule for details - - Each route needs to specify the method to call to get the result (must return a play.mvc.Result object) - - Supplier: used to return results with no args; Function: 1 arg; BiFunction and Function3: 2 and 3 args respectively. - For function/bifunction etc, the arguments are specified with semicolons, like "/myRoute/:myArg"; the called - method should have an appropriate number of arguments to match this. - - Optionally: add code to handle callbacks, storage events, stats storage. See the section below. -- Add the module to the others, in the PlayUIServer. Should be 1 line: ```uiModules.add(new MyNewModule());``` - -## Assets - -Again (due to issues with Maven + Play support), DL4J defines a custom Assets serving system. Assets are static files -such as images, CSS, javascript files, etc. -The contents of /resources/deeplearning4jUiAssets/* get mapped to /assets/* on the running server. To add a new asset, -simply add it to the assets folder, and then reference it as normal in the HTML templates or elsewhere. - -## StatsStorage, Callbacks, and Getting Network and Other Info from DL4J - -The Deeplearning4j UI supports callbacks from StatsStorage. StatsStorage instances are objects/interfaces that store -training information - some of it may be static/stored, some of it may be streaming in, in real-time. - -When a user calls ```UIServer.getInstance().attach(StatsStorage)``` the provided StatsStorage instance will provide -callbacks to the UI whenever something changes. For example, new information from a trained network is added to the -StatsStorage from the StatsListener, the modules that are registered for callbacks (of that type) will be notified. -The UI modules can then query the StatStorage instance (or not) to get the relevant information for displaying in the UI. - -Each UI module specifies the callbacks it wants to receive via Strings (UIModule.getCallbackTypeIDs). Each String is a -key that must match the TypeID of the data to listen for; consequently, there is a correspondence between the TypeID of -the generating class (StatsListener, for example) and the TypeID that the UI module wants to receive. UI modules may -specify zero or more callback type IDs. Any information that is not relevant to the UI module (i.e., doesn't match a -specified TypeID for the module) won't be forwarded on to the UI module. - - -## Internationalization - -The Play framework does provide an internationalization mechanism, though this was found to be problematic when running - Play via a Maven project. Consequently, DL4J defines its own I18N implementation, that is functionally similar to the - Play mechanism. - -The I18N interface, and the DefaultI18N class define getMessage(String) methods. For example, getMessage() -Currently (as of 0.7.2), the language setting is *server side* not client side - thus only one language can be shown per - UI server. Furthermore, the implementation is currently set to fall back to English. - -The actual content for internationalization is present under the resources/dl4j_i18n directory. Each file within this - directory should contain an ISO639 language code (en, ja, de etc) as the extension. -Conceptually, the files may be separated; in practice, the contents of all files (for the relevant language) are -In practice, just add a snippet such as ```@i18n.getMessage("train.pagetitle")``` to the HTML template to get the -appropriate entry for the current language. See the train module UI pages for more examples. - -Note also that it is necessary to provide an I18N instance to the templates. See the TrainModule routing section -for an example on how to do this. diff --git a/deeplearning4j/deeplearning4j-ui-parent/deeplearning4j-play/src/main/java/org/deeplearning4j/ui/api/Route.java b/deeplearning4j/deeplearning4j-ui-parent/deeplearning4j-play/src/main/java/org/deeplearning4j/ui/api/Route.java deleted file mode 100644 index f2dd1e017..000000000 --- a/deeplearning4j/deeplearning4j-ui-parent/deeplearning4j-play/src/main/java/org/deeplearning4j/ui/api/Route.java +++ /dev/null @@ -1,65 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2015-2018 Skymind, Inc. - * - * This program and the accompanying materials are made available under the - * terms of the Apache License, Version 2.0 which is available at - * https://www.apache.org/licenses/LICENSE-2.0. - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT - * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the - * License for the specific language governing permissions and limitations - * under the License. - * - * SPDX-License-Identifier: Apache-2.0 - ******************************************************************************/ - -package org.deeplearning4j.ui.api; - -import lombok.AllArgsConstructor; -import lombok.Data; -import play.mvc.Http; -import play.mvc.Result; - -import java.util.function.BiFunction; -import java.util.function.Function; -import java.util.function.Supplier; - -/** - * A Route specifies an endpoint that can be queried in the UI - along with how it should be handled - * - * @author Alex Black - */ -@Data -@AllArgsConstructor -public class Route { - private final String route; - private final HttpMethod httpMethod; - private final FunctionType functionType; - private final Supplier supplier; - private final Function function; - private final BiFunction function2; - private final Function request0Function; - private final BiFunction request1Function; - - public Route(String route, HttpMethod method, FunctionType functionType, Supplier supplier) { - this(route, method, functionType, supplier, null, null, null, null); - } - - public Route(String route, HttpMethod method, FunctionType functionType, Function function) { - this(route, method, functionType, null, function, null, null, null); - } - - public static Route request0Function(String route, HttpMethod httpMethod, Function function){ - return new Route(route, httpMethod, FunctionType.Request0Function, null, null, null, function, null); - } - - public static Route request1Function(String route, HttpMethod httpMethod, BiFunction function){ - return new Route(route, httpMethod, FunctionType.Request1Function, null, null, null, null, function); - } - - public Route(String route, HttpMethod method, FunctionType functionType, - BiFunction function) { - this(route, method, functionType, null, null, function, null, null); - } -} diff --git a/deeplearning4j/deeplearning4j-ui-parent/deeplearning4j-play/src/main/java/org/deeplearning4j/ui/module/tsne/TsneModule.java b/deeplearning4j/deeplearning4j-ui-parent/deeplearning4j-play/src/main/java/org/deeplearning4j/ui/module/tsne/TsneModule.java deleted file mode 100644 index 0886af8a9..000000000 --- a/deeplearning4j/deeplearning4j-ui-parent/deeplearning4j-play/src/main/java/org/deeplearning4j/ui/module/tsne/TsneModule.java +++ /dev/null @@ -1,163 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2015-2018 Skymind, Inc. - * - * This program and the accompanying materials are made available under the - * terms of the Apache License, Version 2.0 which is available at - * https://www.apache.org/licenses/LICENSE-2.0. - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT - * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the - * License for the specific language governing permissions and limitations - * under the License. - * - * SPDX-License-Identifier: Apache-2.0 - ******************************************************************************/ - -package org.deeplearning4j.ui.module.tsne; - -import org.apache.commons.io.FileUtils; -import org.deeplearning4j.api.storage.StatsStorage; -import org.deeplearning4j.api.storage.StatsStorageEvent; -import org.deeplearning4j.ui.api.FunctionType; -import org.deeplearning4j.ui.api.HttpMethod; -import org.deeplearning4j.ui.api.Route; -import org.deeplearning4j.ui.api.UIModule; -import org.deeplearning4j.ui.i18n.I18NResource; -import play.libs.Files; -import play.libs.Json; -import play.mvc.Http; -import play.mvc.Result; -import play.mvc.Results; - -import java.io.File; -import java.io.IOException; -import java.nio.charset.StandardCharsets; -import java.util.*; - -import static play.mvc.Results.badRequest; -import static play.mvc.Results.ok; - -/** - * Created by Alex on 25/10/2016. - */ -public class TsneModule implements UIModule { - - private static final String UPLOADED_FILE = "UploadedFile"; - - private Map> knownSessionIDs = Collections.synchronizedMap(new LinkedHashMap<>()); - - private List uploadedFileLines = null; - - public TsneModule() { - - } - - @Override - public List getCallbackTypeIDs() { - return Collections.emptyList(); - } - - @Override - public List getRoutes() { - Route r1 = new Route("/tsne", HttpMethod.GET, FunctionType.Supplier, - () -> ok(org.deeplearning4j.ui.views.html.tsne.Tsne.apply())); - Route r2 = new Route("/tsne/sessions", HttpMethod.GET, FunctionType.Supplier, this::listSessions); - Route r3 = new Route("/tsne/coords/:sid", HttpMethod.GET, FunctionType.Function, this::getCoords); - Route r4 = Route.request0Function("/tsne/upload", HttpMethod.POST, this::uploadFile); - Route r5 = Route.request1Function("/tsne/post/:sid", HttpMethod.POST, this::postFile); - return Arrays.asList(r1, r2, r3, r4, r5); - } - - @Override - public void reportStorageEvents(Collection events) { - - } - - @Override - public void onAttach(StatsStorage statsStorage) { - - } - - @Override - public void onDetach(StatsStorage statsStorage) { - - } - - @Override - public List getInternationalizationResources() { - return Collections.emptyList(); - } - - private Result listSessions() { - List list = new ArrayList<>(knownSessionIDs.keySet()); - if (uploadedFileLines != null) { - list.add(UPLOADED_FILE); - } - return Results.ok(Json.toJson(list)); - } - - private Result getCoords(String sessionId) { - if (UPLOADED_FILE.equals(sessionId) && uploadedFileLines != null) { - return Results.ok(Json.toJson(uploadedFileLines)); - } else if (knownSessionIDs.containsKey(sessionId)) { - return Results.ok(Json.toJson(knownSessionIDs.get(sessionId))); - } else { - return Results.ok(); - } - } - - private Result uploadFile(Http.Request request) { - Http.MultipartFormData body = request.body().asMultipartFormData(); - List> fileParts = body.getFiles(); - - if (fileParts.isEmpty()) { - return badRequest("No file uploaded"); - } - - Http.MultipartFormData.FilePart uploadedFile = fileParts.get(0); - - String fileName = uploadedFile.getFilename(); - String contentType = uploadedFile.getContentType(); - File file = uploadedFile.getRef().path().toFile(); - - try { - uploadedFileLines = FileUtils.readLines(file, StandardCharsets.UTF_8); - } catch (IOException e) { - return badRequest("Could not read from uploaded file"); - } - - return ok("File uploaded: " + fileName + ", " + contentType + ", " + file); - } - - private Result postFile(Http.Request request, String sid) { - // System.out.println("POST FILE CALLED: " + sid); - Http.MultipartFormData body = request.body().asMultipartFormData(); - List> fileParts = body.getFiles(); - - if (fileParts.isEmpty()) { - // System.out.println("**** NO FILE ****"); - return badRequest("No file uploaded"); - } - - Http.MultipartFormData.FilePart uploadedFile = fileParts.get(0); - - String fileName = uploadedFile.getFilename(); - String contentType = uploadedFile.getContentType(); - File file = uploadedFile.getRef().path().toFile(); - - List lines; - try { - // Set to uploadedFileLines as well, as the TSNE UI doesn't allow to properly select Sessions yet - lines = uploadedFileLines = FileUtils.readLines(file); - } catch (IOException e) { - // System.out.println("**** COULD NOT READ FILE ****"); - return badRequest("Could not read from uploaded file"); - } - - knownSessionIDs.put(sid, lines); - - - return ok("File uploaded: " + fileName + ", " + contentType + ", " + file); - } -} diff --git a/deeplearning4j/deeplearning4j-ui-parent/deeplearning4j-play/src/main/java/org/deeplearning4j/ui/play/staticroutes/Assets.java b/deeplearning4j/deeplearning4j-ui-parent/deeplearning4j-play/src/main/java/org/deeplearning4j/ui/play/staticroutes/Assets.java deleted file mode 100644 index 76d6e7361..000000000 --- a/deeplearning4j/deeplearning4j-ui-parent/deeplearning4j-play/src/main/java/org/deeplearning4j/ui/play/staticroutes/Assets.java +++ /dev/null @@ -1,68 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2015-2018 Skymind, Inc. - * - * This program and the accompanying materials are made available under the - * terms of the Apache License, Version 2.0 which is available at - * https://www.apache.org/licenses/LICENSE-2.0. - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT - * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the - * License for the specific language governing permissions and limitations - * under the License. - * - * SPDX-License-Identifier: Apache-2.0 - ******************************************************************************/ - -package org.deeplearning4j.ui.play.staticroutes; - -import org.nd4j.shade.guava.net.HttpHeaders; -import lombok.AllArgsConstructor; -import lombok.extern.slf4j.Slf4j; -import org.apache.commons.io.FilenameUtils; -import org.nd4j.linalg.io.ClassPathResource; -import play.mvc.Result; -import play.mvc.StaticFileMimeTypes; - -import java.io.InputStream; -import java.util.Optional; - -import static play.mvc.Results.ok; - -/** - * Simple function for serving assets. Assets are assumed to be in the specified root directory - * - * @author Alex Black - */ -@AllArgsConstructor -@Slf4j -public class Assets { - - public static Result assetRequest(String assetsRootDirectory, String s) { - - String fullPath; - if(s.startsWith("webjars/")){ - fullPath = "META-INF/resources/" + s; - } else { - fullPath = assetsRootDirectory + s; - } - - InputStream inputStream; - try { - inputStream = new ClassPathResource(fullPath).getInputStream(); - } catch (Throwable t) { - log.warn("Could not find requested UI asset: {}", s, t); - return ok(); - } - - String fileName = FilenameUtils.getName(fullPath); - - Optional contentType = StaticFileMimeTypes.fileMimeTypes().forFileName(fileName); - String ct; - ct = contentType.orElse("application/octet-stream"); - - return ok(inputStream) - .withHeader(HttpHeaders.CONTENT_DISPOSITION, "attachment; filename=\"" + fileName + "\"") - .as(ct); - } -} diff --git a/deeplearning4j/deeplearning4j-ui-parent/deeplearning4j-play/src/main/java/org/deeplearning4j/ui/play/staticroutes/I18NRoute.java b/deeplearning4j/deeplearning4j-ui-parent/deeplearning4j-play/src/main/java/org/deeplearning4j/ui/play/staticroutes/I18NRoute.java deleted file mode 100644 index e65170872..000000000 --- a/deeplearning4j/deeplearning4j-ui-parent/deeplearning4j-play/src/main/java/org/deeplearning4j/ui/play/staticroutes/I18NRoute.java +++ /dev/null @@ -1,37 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2015-2018 Skymind, Inc. - * - * This program and the accompanying materials are made available under the - * terms of the Apache License, Version 2.0 which is available at - * https://www.apache.org/licenses/LICENSE-2.0. - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT - * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the - * License for the specific language governing permissions and limitations - * under the License. - * - * SPDX-License-Identifier: Apache-2.0 - ******************************************************************************/ - -package org.deeplearning4j.ui.play.staticroutes; - -import org.deeplearning4j.ui.i18n.I18NProvider; -import play.mvc.Result; - -import java.util.function.Function; - -import static play.mvc.Results.ok; - -/** - * Route for global internationalization setting - * - * @author Alex Black - */ -public class I18NRoute implements Function { - @Override - public Result apply(String s) { - I18NProvider.getInstance().setDefaultLanguage(s); - return ok(); - } -} diff --git a/deeplearning4j/deeplearning4j-ui-parent/deeplearning4j-play/src/main/java/org/deeplearning4j/ui/play/staticroutes/MultiSessionI18NRoute.java b/deeplearning4j/deeplearning4j-ui-parent/deeplearning4j-play/src/main/java/org/deeplearning4j/ui/play/staticroutes/MultiSessionI18NRoute.java deleted file mode 100644 index ccbef0683..000000000 --- a/deeplearning4j/deeplearning4j-ui-parent/deeplearning4j-play/src/main/java/org/deeplearning4j/ui/play/staticroutes/MultiSessionI18NRoute.java +++ /dev/null @@ -1,38 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2015-2019 Skymind, Inc. - * - * This program and the accompanying materials are made available under the - * terms of the Apache License, Version 2.0 which is available at - * https://www.apache.org/licenses/LICENSE-2.0. - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT - * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the - * License for the specific language governing permissions and limitations - * under the License. - * - * SPDX-License-Identifier: Apache-2.0 - ******************************************************************************/ - -package org.deeplearning4j.ui.play.staticroutes; - -import org.deeplearning4j.ui.i18n.I18NProvider; -import play.mvc.Result; - -import java.util.function.BiFunction; - -import static play.mvc.Results.ok; - -/** - * Route for multi-session internationalization setting - * - * @author Tamas Fenyvesi - */ -public class MultiSessionI18NRoute implements BiFunction { - - @Override - public Result apply(String sessionId, String languageCode) { - I18NProvider.getInstance(sessionId).setDefaultLanguage(languageCode); - return ok(); - } -} diff --git a/deeplearning4j/deeplearning4j-ui-parent/deeplearning4j-play/src/main/resources/application.conf b/deeplearning4j/deeplearning4j-ui-parent/deeplearning4j-play/src/main/resources/application.conf deleted file mode 100644 index 28a4aa208..000000000 --- a/deeplearning4j/deeplearning4j-ui-parent/deeplearning4j-play/src/main/resources/application.conf +++ /dev/null @@ -1,350 +0,0 @@ -# This is the main configuration file for the application. -# https://www.playframework.com/documentation/latest/ConfigFile -# ~~~~~ -# Play uses HOCON as its configuration file format. HOCON has a number -# of advantages over other config formats, but there are two things that -# can be used when modifying settings. -# -# You can include other configuration files in this main application.conf file: -#include "extra-config.conf" -# -# You can declare variables and substitute for them: -#mykey = ${some.value} -# -# And if an environment variable exists when there is no other subsitution, then -# HOCON will fall back to substituting environment variable: -#mykey = ${JAVA_HOME} - -## Akka -# https://www.playframework.com/documentation/latest/ScalaAkka#Configuration -# https://www.playframework.com/documentation/latest/JavaAkka#Configuration -# ~~~~~ -# Play uses Akka internally and exposes Akka Streams and actors in Websockets and -# other streaming HTTP responses. -akka { - # "akka.log-config-on-start" is extraordinarly useful because it log the complete - # configuration at INFO level, including defaults and overrides, so it s worth - # putting at the very top. - # - # Put the following in your conf/logback.xml file: - # - # - # - # And then uncomment this line to debug the configuration. - # - #log-config-on-start = true -} - -## Modules -# https://www.playframework.com/documentation/latest/Modules -# ~~~~~ -# Control which modules are loaded when Play starts. Note that modules are -# the replacement for "GlobalSettings", which are deprecated in 2.5.x. -# Please see https://www.playframework.com/documentation/latest/GlobalSettings -# for more information. -# -# You can also extend Play functionality by using one of the publically available -# Play modules: https://playframework.com/documentation/latest/ModuleDirectory -play.modules { - # By default, Play will load any class called Module that is defined - # in the root package (the "app" directory), or you can define them - # explicitly below. - # If there are any built-in modules that you want to disable, you can list them here. - #enabled += my.application.Module - - # If there are any built-in modules that you want to disable, you can list them here. - #disabled += "" -} - -## Internationalisation -# https://www.playframework.com/documentation/latest/JavaI18N -# https://www.playframework.com/documentation/latest/ScalaI18N -# ~~~~~ -# Play comes with its own i18n settings, which allow the user's preferred language -# to map through to internal messages, or allow the language to be stored in a cookie. -play.i18n { - # The application languages - langs = [ "en" ] - - # Whether the language cookie should be secure or not - #langCookieSecure = true - - # Whether the HTTP only attribute of the cookie should be set to true - #langCookieHttpOnly = true -} - -## Play HTTP settings -# ~~~~~ -play.http { - ## Router - # https://www.playframework.com/documentation/latest/JavaRouting - # https://www.playframework.com/documentation/latest/ScalaRouting - # ~~~~~ - # Define the Router object to use for this application. - # This router will be looked up first when the application is starting up, - # so make sure this is the entry point. - # Furthermore, it's assumed your route file is named properly. - # So for an application router like `my.application.Router`, - # you may need to define a router file `conf/my.application.routes`. - # Default to Routes in the root package (aka "apps" folder) (and conf/routes) - #router = my.application.Router - - ## Action Creator - # https://www.playframework.com/documentation/latest/JavaActionCreator - # ~~~~~ - #actionCreator = null - - ## ErrorHandler - # https://www.playframework.com/documentation/latest/JavaRouting - # https://www.playframework.com/documentation/latest/ScalaRouting - # ~~~~~ - # If null, will attempt to load a class called ErrorHandler in the root package, - #errorHandler = null - - ## Filters - # https://www.playframework.com/documentation/latest/ScalaHttpFilters - # https://www.playframework.com/documentation/latest/JavaHttpFilters - # ~~~~~ - # Filters run code on every request. They can be used to perform - # common logic for all your actions, e.g. adding common headers. - # Defaults to "Filters" in the root package (aka "apps" folder) - # Alternatively you can explicitly register a class here. - #filters += my.application.Filters - - ## Session & Flash - # https://www.playframework.com/documentation/latest/JavaSessionFlash - # https://www.playframework.com/documentation/latest/ScalaSessionFlash - # ~~~~~ - session { - # Sets the cookie to be sent only over HTTPS. - #secure = true - - # Sets the cookie to be accessed only by the server. - #httpOnly = true - - # Sets the max-age field of the cookie to 5 minutes. - # NOTE: this only sets when the browser will discard the cookie. Play will consider any - # cookie value with a valid signature to be a valid session forever. To implement a server side session timeout, - # you need to put a timestamp in the session and check it at regular intervals to possibly expire it. - #maxAge = 300 - - # Sets the domain on the session cookie. - #domain = "example.com" - } - - flash { - # Sets the cookie to be sent only over HTTPS. - #secure = true - - # Sets the cookie to be accessed only by the server. - #httpOnly = true - } -} - -## Netty Provider -# https://www.playframework.com/documentation/latest/SettingsNetty -# ~~~~~ -play.server.netty { - # Whether the Netty wire should be logged - #log.wire = true - - # If you run Play on Linux, you can use Netty's native socket transport - # for higher performance with less garbage. - #transport = "native" -} - -## WS (HTTP Client) -# https://www.playframework.com/documentation/latest/ScalaWS#Configuring-WS -# ~~~~~ -# The HTTP client primarily used for REST APIs. The default client can be -# configured directly, but you can also create different client instances -# with customized settings. You must enable this by adding to build.sbt: -# -# libraryDependencies += ws // or javaWs if using java -# -play.ws { - # Sets HTTP requests not to follow 302 requests - #followRedirects = false - - # Sets the maximum number of open HTTP connections for the client. - #ahc.maxConnectionsTotal = 50 - - ## WS SSL - # https://www.playframework.com/documentation/latest/WsSSL - # ~~~~~ - ssl { - # Configuring HTTPS with Play WS does not require programming. You can - # set up both trustManager and keyManager for mutual authentication, and - # turn on JSSE debugging in development with a reload. - #debug.handshake = true - #trustManager = { - # stores = [ - # { type = "JKS", path = "exampletrust.jks" } - # ] - #} - } -} - -## Cache -# https://www.playframework.com/documentation/latest/JavaCache -# https://www.playframework.com/documentation/latest/ScalaCache -# ~~~~~ -# Play comes with an integrated cache API that can reduce the operational -# overhead of repeated requests. You must enable this by adding to build.sbt: -# -# libraryDependencies += cache -# -play.cache { - # If you want to bind several caches, you can bind the individually - #bindCaches = ["db-cache", "user-cache", "session-cache"] -} - -## Filters -# https://www.playframework.com/documentation/latest/Filters -# ~~~~~ -# There are a number of built-in filters that can be enabled and configured -# to give Play greater security. You must enable this by adding to build.sbt: -# -# libraryDependencies += filters -# -play.filters { - ## CORS filter configuration - # https://www.playframework.com/documentation/latest/CorsFilter - # ~~~~~ - # CORS is a protocol that allows web applications to make requests from the browser - # across different domains. - # NOTE: You MUST apply the CORS configuration before the CSRF filter, as CSRF has - # dependencies on CORS settings. - cors { - # Filter paths by a whitelist of path prefixes - #pathPrefixes = ["/some/path", ...] - - # The allowed origins. If null, all origins are allowed. - #allowedOrigins = ["http://www.example.com"] - - # The allowed HTTP methods. If null, all methods are allowed - #allowedHttpMethods = ["GET", "POST"] - } - - ## CSRF Filter - # https://www.playframework.com/documentation/latest/ScalaCsrf#Applying-a-global-CSRF-filter - # https://www.playframework.com/documentation/latest/JavaCsrf#Applying-a-global-CSRF-filter - # ~~~~~ - # Play supports multiple methods for verifying that a request is not a CSRF request. - # The primary mechanism is a CSRF token. This token gets placed either in the query string - # or body of every form submitted, and also gets placed in the users session. - # Play then verifies that both tokens are present and match. - csrf { - # Sets the cookie to be sent only over HTTPS - #cookie.secure = true - - # Defaults to CSRFErrorHandler in the root package. - #errorHandler = MyCSRFErrorHandler - } - - ## Security headers filter configuration - # https://www.playframework.com/documentation/latest/SecurityHeaders - # ~~~~~ - # Defines security headers that prevent XSS attacks. - # If enabled, then all options are set to the below configuration by default: - headers { - # The X-Frame-Options header. If null, the header is not set. - #frameOptions = "DENY" - - # The X-XSS-Protection header. If null, the header is not set. - #xssProtection = "1; mode=block" - - # The X-Content-Type-Options header. If null, the header is not set. - #contentTypeOptions = "nosniff" - - # The X-Permitted-Cross-Domain-Policies header. If null, the header is not set. - #permittedCrossDomainPolicies = "master-only" - - # The Content-Security-Policy header. If null, the header is not set. - #contentSecurityPolicy = "default-src 'self'" - } - - ## Allowed hosts filter configuration - # https://www.playframework.com/documentation/latest/AllowedHostsFilter - # ~~~~~ - # Play provides a filter that lets you configure which hosts can access your application. - # This is useful to prevent cache poisoning attacks. - hosts { - # Allow requests to example.com, its subdomains, and localhost:9000. - #allowed = [".example.com", "localhost:9000"] - } -} - -## Evolutions -# https://www.playframework.com/documentation/latest/Evolutions -# ~~~~~ -# Evolutions allows database scripts to be automatically run on startup in dev mode -# for database migrations. You must enable this by adding to build.sbt: -# -# libraryDependencies += evolutions -# -play.evolutions { - # You can disable evolutions for a specific datasource if necessary - #db.default.enabled = false -} - -## Database Connection Pool -# https://www.playframework.com/documentation/latest/SettingsJDBC -# ~~~~~ -# Play doesn't require a JDBC database to run, but you can easily enable one. -# -# libraryDependencies += jdbc -# -play.db { - # The combination of these two settings results in "db.default" as the - # default JDBC pool: - #config = "db" - #default = "default" - - # Play uses HikariCP as the default connection pool. You can override - # settings by changing the prototype: - prototype { - # Sets a fixed JDBC connection pool size of 50 - #hikaricp.minimumIdle = 50 - #hikaricp.maximumPoolSize = 50 - } -} - -## JDBC Datasource -# https://www.playframework.com/documentation/latest/JavaDatabase -# https://www.playframework.com/documentation/latest/ScalaDatabase -# ~~~~~ -# Once JDBC datasource is set up, you can work with several different -# database options: -# -# Slick (Scala preferred option): https://www.playframework.com/documentation/latest/PlaySlick -# JPA (Java preferred option): https://playframework.com/documentation/latest/JavaJPA -# EBean: https://playframework.com/documentation/latest/JavaEbean -# Anorm: https://www.playframework.com/documentation/latest/ScalaAnorm -# -db { - # You can declare as many datasources as you want. - # By convention, the default datasource is named `default` - - # https://www.playframework.com/documentation/latest/Developing-with-the-H2-Database - default.driver = org.h2.Driver - default.url = "jdbc:h2:mem:play" - #default.username = sa - #default.password = "" - - # You can expose this datasource via JNDI if needed (Useful for JPA) - default.jndiName=DefaultDS - - # You can turn on SQL logging for any datasource - # https://www.playframework.com/documentation/latest/Highlights25#Logging-SQL-statements - #default.logSql=true -} - -jpa.default=defaultPersistenceUnit - - -#Increase default maximum post length - used for remote listener functionality -#Can get response 413 with larger networks without setting this -# parsers.text.maxLength is deprecated, use play.http.parser.maxMemoryBuffer instead -#parsers.text.maxLength=10M -play.http.parser.maxMemoryBuffer=10M diff --git a/deeplearning4j/deeplearning4j-ui-parent/deeplearning4j-play/src/main/scala/org/deeplearning4j/ui/views/html/convolutional/Activations.template.scala b/deeplearning4j/deeplearning4j-ui-parent/deeplearning4j-play/src/main/scala/org/deeplearning4j/ui/views/html/convolutional/Activations.template.scala deleted file mode 100644 index 20672a6bd..000000000 --- a/deeplearning4j/deeplearning4j-ui-parent/deeplearning4j-play/src/main/scala/org/deeplearning4j/ui/views/html/convolutional/Activations.template.scala +++ /dev/null @@ -1,159 +0,0 @@ - -/******************************************************************************* - * Copyright (c) 2015-2019 Skymind, Inc. - * - * This program and the accompanying materials are made available under the - * terms of the Apache License, Version 2.0 which is available at - * https://www.apache.org/licenses/LICENSE-2.0. - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT - * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the - * License for the specific language governing permissions and limitations - * under the License. - * - * SPDX-License-Identifier: Apache-2.0 - ******************************************************************************/ - -package org.deeplearning4j.ui.views.html.convolutional - -import play.twirl.api._ -import play.twirl.api.TemplateMagic._ - - - object Activations_Scope0 { -import models._ -import controllers._ -import play.api.i18n._ -import views.html._ -import play.api.templates.PlayMagic._ -import play.api.mvc._ -import play.api.data._ - -class Activations extends BaseScalaTemplate[play.twirl.api.HtmlFormat.Appendable,Format[play.twirl.api.HtmlFormat.Appendable]](play.twirl.api.HtmlFormat) with play.twirl.api.Template0[play.twirl.api.HtmlFormat.Appendable] { - - /**/ - def apply():play.twirl.api.HtmlFormat.Appendable = { - _display_ { - { - - -Seq[Any](format.raw/*1.1*/(""" - - - - - - - Neural Network activations - - - """),format.raw/*25.68*/(""" - """),format.raw/*26.13*/(""" - - - - - - - - - - - - - - - - - - - - - - -
DeepLearning4j UI 
-

-
-
- -
-
- - -""")) - } - } - } - - def render(): play.twirl.api.HtmlFormat.Appendable = apply() - - def f:(() => play.twirl.api.HtmlFormat.Appendable) = () => apply() - - def ref: this.type = this - -} - - -} - -/**/ -object Activations extends Activations_Scope0.Activations - /* - -- GENERATED -- - DATE: Tue May 07 21:39:40 AEST 2019 - SOURCE: c:/DL4J/Git/deeplearning4j/deeplearning4j/deeplearning4j-ui-parent/deeplearning4j-play/src/main/views/org/deeplearning4j/ui/views/convolutional/Activations.scala.html - HASH: fb7b9cdfdd31f76d21208213b839aeebac3dabe2 - MATRIX: 657->0|1724->1098|1766->1112|2133->1451|2162->1452|2204->1466|2362->1597|2391->1598|2430->1610|2462->1614|2491->1615|2533->1629|2655->1724|2684->1725|2723->1737|2758->1744|2787->1745|2829->1759|3016->1919|3045->1920|3084->1932|3122->1942|3151->1943|3193->1957|3315->2052|3344->2053|3381->2063|3494->2148|3523->2149|3565->2163|3730->2301|3759->2302 - LINES: 25->1|49->25|50->26|57->33|57->33|58->34|62->38|62->38|64->40|64->40|64->40|65->41|68->44|68->44|70->46|70->46|70->46|71->47|76->52|76->52|78->54|78->54|78->54|79->55|82->58|82->58|83->59|86->62|86->62|87->63|89->65|89->65 - -- GENERATED -- - */ - \ No newline at end of file diff --git a/deeplearning4j/deeplearning4j-ui-parent/deeplearning4j-play/src/main/scala/org/deeplearning4j/ui/views/html/samediff/SameDiffUI.template.scala b/deeplearning4j/deeplearning4j-ui-parent/deeplearning4j-play/src/main/scala/org/deeplearning4j/ui/views/html/samediff/SameDiffUI.template.scala deleted file mode 100644 index 80191c81d..000000000 --- a/deeplearning4j/deeplearning4j-ui-parent/deeplearning4j-play/src/main/scala/org/deeplearning4j/ui/views/html/samediff/SameDiffUI.template.scala +++ /dev/null @@ -1,240 +0,0 @@ - -/******************************************************************************* - * Copyright (c) 2015-2019 Skymind, Inc. - * - * This program and the accompanying materials are made available under the - * terms of the Apache License, Version 2.0 which is available at - * https://www.apache.org/licenses/LICENSE-2.0. - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT - * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the - * License for the specific language governing permissions and limitations - * under the License. - * - * SPDX-License-Identifier: Apache-2.0 - ******************************************************************************/ - -package org.deeplearning4j.ui.views.html.samediff - -import play.twirl.api._ -import play.twirl.api.TemplateMagic._ - - - object SameDiffUI_Scope0 { -import models._ -import controllers._ -import play.api.i18n._ -import views.html._ -import play.api.templates.PlayMagic._ -import play.api.mvc._ -import play.api.data._ - -class SameDiffUI extends BaseScalaTemplate[play.twirl.api.HtmlFormat.Appendable,Format[play.twirl.api.HtmlFormat.Appendable]](play.twirl.api.HtmlFormat) with play.twirl.api.Template0[play.twirl.api.HtmlFormat.Appendable] { - - /**/ - def apply/*1.2*/():play.twirl.api.HtmlFormat.Appendable = { - _display_ { - { - - -Seq[Any](format.raw/*1.4*/(""" -"""),format.raw/*2.1*/(""" - - - - - - - - SameDiff Graph Visualization - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - """),format.raw/*71.34*/(""" - """),format.raw/*72.9*/("""
- - -
- - """),format.raw/*98.47*/(""" - """),format.raw/*99.17*/("""
- """),format.raw/*100.81*/(""" - """),format.raw/*101.21*/("""
-
- -
-
[No File Loaded]
-
- -
- - """),format.raw/*114.85*/(""" - """),format.raw/*115.21*/("""
-
Selected Node:
-
(None)
-
- -
- -
-
- Find Node:
-
- -
- -
-
- -
- - """),format.raw/*134.87*/(""" - """),format.raw/*135.21*/("""
-

- Graph Layout: -
- - - - -
-
-
-
-
-
- - -
-
-
-
-
- - - - - - -""")) - } - } - } - - def render(): play.twirl.api.HtmlFormat.Appendable = apply() - - def f:(() => play.twirl.api.HtmlFormat.Appendable) = () => apply() - - def ref: this.type = this - -} - - -} - -/**/ -object SameDiffUI extends SameDiffUI_Scope0.SameDiffUI - /* - -- GENERATED -- - DATE: Tue May 07 21:39:40 AEST 2019 - SOURCE: c:/DL4J/Git/deeplearning4j/deeplearning4j/deeplearning4j-ui-parent/deeplearning4j-play/src/main/views/org/deeplearning4j/ui/views/samediff/SameDiffUI.scala.html - HASH: d80f43e3f37ebbfb22768edb52560e2d6d6fcb2a - MATRIX: 561->1|657->3|685->5|4621->3938|4658->3948|6437->5729|6483->5747|6664->5959|6715->5981|7384->6685|7435->6707|8217->7526|8268->7548|10114->9365|10144->9366|10195->9388|10264->9428|10294->9429 - LINES: 20->1|25->1|26->2|95->71|96->72|122->98|123->99|124->100|125->101|138->114|139->115|158->134|159->135|191->167|191->167|192->168|193->169|193->169 - -- GENERATED -- - */ - \ No newline at end of file diff --git a/deeplearning4j/deeplearning4j-ui-parent/deeplearning4j-play/src/main/scala/org/deeplearning4j/ui/views/html/samediff/SameDiffUIBackup.template.scala b/deeplearning4j/deeplearning4j-ui-parent/deeplearning4j-play/src/main/scala/org/deeplearning4j/ui/views/html/samediff/SameDiffUIBackup.template.scala deleted file mode 100644 index 426384ec4..000000000 --- a/deeplearning4j/deeplearning4j-ui-parent/deeplearning4j-play/src/main/scala/org/deeplearning4j/ui/views/html/samediff/SameDiffUIBackup.template.scala +++ /dev/null @@ -1,175 +0,0 @@ - -/******************************************************************************* - * Copyright (c) 2015-2019 Skymind, Inc. - * - * This program and the accompanying materials are made available under the - * terms of the Apache License, Version 2.0 which is available at - * https://www.apache.org/licenses/LICENSE-2.0. - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT - * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the - * License for the specific language governing permissions and limitations - * under the License. - * - * SPDX-License-Identifier: Apache-2.0 - ******************************************************************************/ - -package org.deeplearning4j.ui.views.html.samediff - -import play.twirl.api._ -import play.twirl.api.TemplateMagic._ - - - object SameDiffUIBackup_Scope0 { -import models._ -import controllers._ -import play.api.i18n._ -import views.html._ -import play.api.templates.PlayMagic._ -import play.api.mvc._ -import play.api.data._ - -class SameDiffUIBackup extends BaseScalaTemplate[play.twirl.api.HtmlFormat.Appendable,Format[play.twirl.api.HtmlFormat.Appendable]](play.twirl.api.HtmlFormat) with play.twirl.api.Template0[play.twirl.api.HtmlFormat.Appendable] { - - /**/ - def apply/*1.2*/():play.twirl.api.HtmlFormat.Appendable = { - _display_ { - { - - -Seq[Any](format.raw/*1.4*/(""" -"""),format.raw/*2.1*/(""" - - - - - - - - SameDiff Graph Visualization - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
-
- - - """),format.raw/*77.78*/(""" - """),format.raw/*78.17*/("""
- Layout: - - - - """),format.raw/*83.76*/(""" - """),format.raw/*84.78*/(""" - """),format.raw/*85.74*/(""" - """),format.raw/*86.21*/(""" - - """),format.raw/*88.74*/(""" - """),format.raw/*89.17*/("""
-
-
-
- -
- - - - - - -""")) - } - } - } - - def render(): play.twirl.api.HtmlFormat.Appendable = apply() - - def f:(() => play.twirl.api.HtmlFormat.Appendable) = () => apply() - - def ref: this.type = this - -} - - -} - -/**/ -object SameDiffUIBackup extends SameDiffUIBackup_Scope0.SameDiffUIBackup - /* - -- GENERATED -- - DATE: Sat Jan 26 18:11:00 AEDT 2019 - SOURCE: c:/DL4J/Git/deeplearning4j/deeplearning4j/deeplearning4j-ui-parent/deeplearning4j-play/src/main/views/org/deeplearning4j/ui/views/samediff/SameDiffUIBackup.scala.html - HASH: 5bbca606352004bcd370a7bff06c376141f0d082 - MATRIX: 573->1|669->3|697->5|4607->3948|4653->3966|4993->4333|5043->4412|5093->4487|5143->4509|5346->4737|5392->4755|5813->5147|5843->5148|5894->5170|5963->5210|5993->5211 - LINES: 20->1|25->1|26->2|101->77|102->78|107->83|108->84|109->85|110->86|112->88|113->89|126->102|126->102|127->103|128->104|128->104 - -- GENERATED -- - */ - \ No newline at end of file diff --git a/deeplearning4j/deeplearning4j-ui-parent/deeplearning4j-play/src/main/scala/org/deeplearning4j/ui/views/html/training/TrainingModel.template.scala b/deeplearning4j/deeplearning4j-ui-parent/deeplearning4j-play/src/main/scala/org/deeplearning4j/ui/views/html/training/TrainingModel.template.scala deleted file mode 100644 index 16b37a3a9..000000000 --- a/deeplearning4j/deeplearning4j-ui-parent/deeplearning4j-play/src/main/scala/org/deeplearning4j/ui/views/html/training/TrainingModel.template.scala +++ /dev/null @@ -1,334 +0,0 @@ - -/******************************************************************************* - * Copyright (c) 2015-2019 Skymind, Inc. - * - * This program and the accompanying materials are made available under the - * terms of the Apache License, Version 2.0 which is available at - * https://www.apache.org/licenses/LICENSE-2.0. - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT - * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the - * License for the specific language governing permissions and limitations - * under the License. - * - * SPDX-License-Identifier: Apache-2.0 - ******************************************************************************/ - -package org.deeplearning4j.ui.views.html.training - -import play.twirl.api._ -import play.twirl.api.TemplateMagic._ - - - object TrainingModel_Scope0 { -import models._ -import controllers._ -import play.api.i18n._ -import views.html._ -import play.api.templates.PlayMagic._ -import play.api.mvc._ -import play.api.data._ - -class TrainingModel extends BaseScalaTemplate[play.twirl.api.HtmlFormat.Appendable,Format[play.twirl.api.HtmlFormat.Appendable]](play.twirl.api.HtmlFormat) with play.twirl.api.Template1[org.deeplearning4j.ui.api.I18N,play.twirl.api.HtmlFormat.Appendable] { - - /**/ - def apply/*1.2*/(i18n: org.deeplearning4j.ui.api.I18N):play.twirl.api.HtmlFormat.Appendable = { - _display_ { - { - - -Seq[Any](format.raw/*1.40*/(""" -"""),format.raw/*2.1*/(""" - - - - - - - - """),_display_(/*24.17*/i18n/*24.21*/.getMessage("train.pagetitle")),format.raw/*24.51*/(""" - - - - - - - - - - - - - - - - - - - - - - - -
- - - - - -
-
-
-
-
- - -
- -
-
-

"""),_display_(/*109.49*/i18n/*109.53*/.getMessage("train.model.layerInfoTable.title")),format.raw/*109.100*/("""

-
-
-
-
-
- -
- -
-
-

log - 10 """),_display_(/*128.51*/i18n/*128.55*/.getMessage("train.overview.chart.updateRatioTitleShort")),format.raw/*128.112*/(""" 0, """),_display_(/*128.165*/i18n/*128.169*/.getMessage("train.overview.charts.iteration")),format.raw/*128.215*/(""": 0

-
-
-
-
-

"""),_display_(/*133.49*/i18n/*133.53*/.getMessage("train.model.activationsChart.title")),format.raw/*133.102*/("""

-
-
-
-

"""),_display_(/*137.63*/i18n/*137.67*/.getMessage("train.model.activationsChart.titleShort")),format.raw/*137.121*/(""" - """),format.raw/*138.33*/(""": 0 - , """),_display_(/*139.47*/i18n/*139.51*/.getMessage("train.overview.charts.iteration")),format.raw/*139.97*/(""" - """),format.raw/*140.33*/(""": 0

-
-
- -
-
-

"""),_display_(/*146.49*/i18n/*146.53*/.getMessage("train.model.paramHistChart.title")),format.raw/*146.100*/("""

-
-
-
-
-
-
-
- -
-
-

"""),_display_(/*157.49*/i18n/*157.53*/.getMessage("train.model.updateHistChart.title")),format.raw/*157.101*/("""

-
-
-
-
-
-
-
- -
-
-

"""),_display_(/*168.49*/i18n/*168.53*/.getMessage("train.model.lrChart.title")),format.raw/*168.93*/("""

-
-
-
-

"""),_display_(/*172.63*/i18n/*172.67*/.getMessage("train.model.lrChart.titleShort")),format.raw/*172.112*/(""" - """),format.raw/*173.33*/(""": 0 - , """),_display_(/*174.47*/i18n/*174.51*/.getMessage("train.overview.charts.iteration")),format.raw/*174.97*/(""" - """),format.raw/*175.33*/(""": 0

-
-
- -
- - - -
-
-
-

Getting Started

-
-
- -
-
-

Overview

-

- The layer visualization UI renders network structure dynamically. Users can inspect node layer parameters by clicking on the various elements of the GUI to see general information as well as overall network information such as performance. -

-

Actions

-

On the left, you will find an interactive layer visualization.

-

-

    -
  • Clicking - Click on a layer to load network performance metrics.
  • -
  • Scrolling - - Drag the GUI with your mouse or touchpad to move the model around.
  • -
-

-
-
-
-
-
- -
- - - - - -
- -
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -""")) - } - } - } - - def render(i18n:org.deeplearning4j.ui.api.I18N): play.twirl.api.HtmlFormat.Appendable = apply(i18n) - - def f:((org.deeplearning4j.ui.api.I18N) => play.twirl.api.HtmlFormat.Appendable) = (i18n) => apply(i18n) - - def ref: this.type = this - -} - - -} - -/**/ -object TrainingModel extends TrainingModel_Scope0.TrainingModel - /* - -- GENERATED -- - DATE: Tue May 07 21:39:41 AEST 2019 - SOURCE: c:/DL4J/Git/deeplearning4j/deeplearning4j/deeplearning4j-ui-parent/deeplearning4j-play/src/main/views/org/deeplearning4j/ui/views/training/TrainingModel.scala.html - HASH: e97fc151ff2478d42c14c4d98e2cf87aa2ee049f - MATRIX: 598->1|731->39|759->41|1677->932|1690->936|1741->966|2753->1951|2766->1955|2817->1985|2988->2129|3001->2133|3056->2167|3409->2493|3422->2497|3484->2538|4020->3046|4034->3050|4089->3083|4241->3207|4255->3211|4307->3241|4466->3372|4480->3376|4533->3407|4778->3625|4791->3629|4846->3662|4904->3692|6344->5104|6373->5105|6423->5127|6607->5283|6636->5284|6682->5302|7246->5838|7260->5842|7330->5889|7824->6355|7838->6359|7913->6411|8280->6749|8295->6753|8362->6797|8536->6942|8551->6946|8618->6990|8794->7137|8809->7141|8877->7186|9326->7607|9340->7611|9420->7668|9502->7721|9517->7725|9586->7771|9900->8057|9914->8061|9986->8110|10295->8391|10309->8395|10386->8449|10449->8483|10563->8569|10577->8573|10645->8619|10708->8653|11029->8946|11043->8950|11113->8997|11843->9699|11857->9703|11928->9751|12657->10452|12671->10456|12733->10496|13043->10778|13057->10782|13125->10827|13188->10861|13303->10948|13317->10952|13385->10998|13448->11032|18024->15579|18054->15580|18104->15601|18212->15680|18242->15681|18413->15823|18443->15824|18494->15846|18564->15887|18594->15888 - LINES: 20->1|25->1|26->2|48->24|48->24|48->24|70->46|70->46|70->46|72->48|72->48|72->48|78->54|78->54|78->54|90->66|90->66|90->66|91->67|91->67|91->67|92->68|92->68|92->68|95->71|95->71|95->71|96->72|113->89|113->89|114->90|118->94|118->94|119->95|133->109|133->109|133->109|142->118|142->118|142->118|144->120|144->120|144->120|145->121|145->121|145->121|146->122|146->122|146->122|152->128|152->128|152->128|152->128|152->128|152->128|157->133|157->133|157->133|161->137|161->137|161->137|162->138|163->139|163->139|163->139|164->140|170->146|170->146|170->146|181->157|181->157|181->157|192->168|192->168|192->168|196->172|196->172|196->172|197->173|198->174|198->174|198->174|199->175|277->253|277->253|278->254|280->256|280->256|285->261|285->261|286->262|287->263|287->263 - -- GENERATED -- - */ - \ No newline at end of file diff --git a/deeplearning4j/deeplearning4j-ui-parent/deeplearning4j-play/src/main/scala/org/deeplearning4j/ui/views/html/training/TrainingOverview.template.scala b/deeplearning4j/deeplearning4j-ui-parent/deeplearning4j-play/src/main/scala/org/deeplearning4j/ui/views/html/training/TrainingOverview.template.scala deleted file mode 100644 index 64469ca6a..000000000 --- a/deeplearning4j/deeplearning4j-ui-parent/deeplearning4j-play/src/main/scala/org/deeplearning4j/ui/views/html/training/TrainingOverview.template.scala +++ /dev/null @@ -1,288 +0,0 @@ - -/******************************************************************************* - * Copyright (c) 2015-2019 Skymind, Inc. - * - * This program and the accompanying materials are made available under the - * terms of the Apache License, Version 2.0 which is available at - * https://www.apache.org/licenses/LICENSE-2.0. - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT - * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the - * License for the specific language governing permissions and limitations - * under the License. - * - * SPDX-License-Identifier: Apache-2.0 - ******************************************************************************/ - -package org.deeplearning4j.ui.views.html.training - -import play.twirl.api._ -import play.twirl.api.TemplateMagic._ - - - object TrainingOverview_Scope0 { -import models._ -import controllers._ -import play.api.i18n._ -import views.html._ -import play.api.templates.PlayMagic._ -import play.api.mvc._ -import play.api.data._ - -class TrainingOverview extends BaseScalaTemplate[play.twirl.api.HtmlFormat.Appendable,Format[play.twirl.api.HtmlFormat.Appendable]](play.twirl.api.HtmlFormat) with play.twirl.api.Template1[org.deeplearning4j.ui.api.I18N,play.twirl.api.HtmlFormat.Appendable] { - - /**/ - def apply/*1.2*/(i18n: org.deeplearning4j.ui.api.I18N):play.twirl.api.HtmlFormat.Appendable = { - _display_ { - { - - -Seq[Any](format.raw/*1.40*/(""" -"""),format.raw/*2.1*/(""" - - - - - - - - """),_display_(/*24.17*/i18n/*24.21*/.getMessage("train.pagetitle")),format.raw/*24.51*/(""" - - - - - - - - - - - - - - - - - - - - - -
- -
-
- -
-
-

"""),_display_(/*89.37*/i18n/*89.41*/.getMessage("train.overview.chart.scoreTitle")),format.raw/*89.87*/("""

-
-
-
-

"""),_display_(/*93.51*/i18n/*93.55*/.getMessage("train.overview.chart.scoreTitleShort")),format.raw/*93.106*/(""" - """),format.raw/*94.33*/(""": 0, """),_display_(/*94.66*/i18n/*94.70*/.getMessage("train.overview.charts.iteration")),format.raw/*94.116*/(""" - """),format.raw/*95.33*/(""": - 0

-
-
- - -
-
-

"""),_display_(/*103.37*/i18n/*103.41*/.getMessage("train.overview.perftable.title")),format.raw/*103.86*/("""

-
-
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
"""),_display_(/*108.42*/i18n/*108.46*/.getMessage("train.overview.modeltable.modeltype")),format.raw/*108.96*/("""Loading...
"""),_display_(/*112.42*/i18n/*112.46*/.getMessage("train.overview.modeltable.nLayers")),format.raw/*112.94*/("""Loading...
"""),_display_(/*116.42*/i18n/*116.46*/.getMessage("train.overview.modeltable.nParams")),format.raw/*116.94*/("""Loading...
"""),_display_(/*120.42*/i18n/*120.46*/.getMessage("train.overview.perftable.startTime")),format.raw/*120.95*/("""Loading...
"""),_display_(/*124.42*/i18n/*124.46*/.getMessage("train.overview.perftable.totalRuntime")),format.raw/*124.98*/("""Loading...
"""),_display_(/*128.42*/i18n/*128.46*/.getMessage("train.overview.perftable.lastUpdate")),format.raw/*128.96*/("""Loading...
"""),_display_(/*132.42*/i18n/*132.46*/.getMessage("train.overview.perftable.totalParamUpdates")),format.raw/*132.103*/("""Loading...
"""),_display_(/*136.42*/i18n/*136.46*/.getMessage("train.overview.perftable.updatesPerSec")),format.raw/*136.99*/("""Loading...
"""),_display_(/*140.42*/i18n/*140.46*/.getMessage("train.overview.perftable.examplesPerSec")),format.raw/*140.100*/("""Loading...
-
-
- -
- - -
- -
-
-

"""),_display_(/*154.37*/i18n/*154.41*/.getMessage("train.overview.chart.updateRatioTitle")),format.raw/*154.93*/(""": log10

-
-
-
-

"""),_display_(/*158.51*/i18n/*158.55*/.getMessage("train.overview.chart.updateRatioTitleShort")),format.raw/*158.112*/(""" - """),format.raw/*159.33*/(""": 0, log - 10 """),_display_(/*160.43*/i18n/*160.47*/.getMessage("train.overview.chart.updateRatioTitleShort")),format.raw/*160.104*/(""" - """),format.raw/*161.33*/(""": 0 - , """),_display_(/*162.39*/i18n/*162.43*/.getMessage("train.overview.charts.iteration")),format.raw/*162.89*/(""": - 0

-
- -
- - -
- -
-
-

"""),_display_(/*180.51*/i18n/*180.55*/.getMessage("train.overview.chart.stdevTitleShort")),format.raw/*180.106*/(""" - """),format.raw/*181.33*/(""": 0, log - 10 """),_display_(/*182.43*/i18n/*182.47*/.getMessage("train.overview.chart.stdevTitleShort")),format.raw/*182.98*/(""" - """),format.raw/*183.33*/(""": 0 - , """),_display_(/*184.39*/i18n/*184.43*/.getMessage("train.overview.charts.iteration")),format.raw/*184.89*/(""": - 0

-
-
- -
-
-
- - - - - - - - - - - - - - - - - - - - - -""")) - } - } - } - - def render(i18n:org.deeplearning4j.ui.api.I18N): play.twirl.api.HtmlFormat.Appendable = apply(i18n) - - def f:((org.deeplearning4j.ui.api.I18N) => play.twirl.api.HtmlFormat.Appendable) = (i18n) => apply(i18n) - - def ref: this.type = this - -} - - -} - -/**/ -object TrainingOverview extends TrainingOverview_Scope0.TrainingOverview - /* - -- GENERATED -- - DATE: Tue May 07 21:39:41 AEST 2019 - SOURCE: c:/DL4J/Git/deeplearning4j/deeplearning4j/deeplearning4j-ui-parent/deeplearning4j-play/src/main/views/org/deeplearning4j/ui/views/training/TrainingOverview.scala.html - HASH: 2c9149a6ec8ab4fcc1b316e6ecd5befab2c45af1 - MATRIX: 604->1|737->39|765->41|1683->932|1696->936|1747->966|2759->1951|2772->1955|2823->1985|2994->2129|3007->2133|3062->2167|3415->2493|3428->2497|3490->2538|3995->3015|4009->3019|4064->3052|4216->3176|4230->3180|4282->3210|4441->3341|4455->3345|4508->3376|4753->3594|4766->3598|4821->3631|4879->3661|6460->5215|6473->5219|6540->5265|6791->5489|6804->5493|6877->5544|6939->5578|6999->5611|7012->5615|7080->5661|7142->5695|7536->6061|7550->6065|7617->6110|7894->6359|7908->6363|7980->6413|8205->6610|8219->6614|8289->6662|8512->6857|8526->6861|8596->6909|8819->7104|8833->7108|8904->7157|9129->7354|9143->7358|9217->7410|9445->7610|9459->7614|9531->7664|9757->7862|9771->7866|9851->7923|10084->8128|10098->8132|10173->8185|10402->8386|10416->8390|10493->8444|11042->8965|11056->8969|11130->9021|11422->9285|11436->9289|11516->9346|11579->9380|11696->9469|11710->9473|11790->9530|11853->9564|11956->9639|11970->9643|12038->9689|12444->10067|12458->10071|12526->10117|12858->10420|12873->10424|12952->10480|13124->10623|13139->10627|13216->10681|13384->10820|13399->10824|13474->10876|13777->11151|13791->11155|13865->11206|13928->11240|14045->11329|14059->11333|14132->11384|14195->11418|14298->11493|14312->11497|14380->11543|15679->12813|15709->12814|15760->12836|15832->12879|15862->12880|16027->13016|16057->13017|16108->13039|16181->13083|16211->13084 - LINES: 20->1|25->1|26->2|48->24|48->24|48->24|70->46|70->46|70->46|72->48|72->48|72->48|78->54|78->54|78->54|88->64|88->64|88->64|89->65|89->65|89->65|90->66|90->66|90->66|93->69|93->69|93->69|94->70|113->89|113->89|113->89|117->93|117->93|117->93|118->94|118->94|118->94|118->94|119->95|127->103|127->103|127->103|132->108|132->108|132->108|136->112|136->112|136->112|140->116|140->116|140->116|144->120|144->120|144->120|148->124|148->124|148->124|152->128|152->128|152->128|156->132|156->132|156->132|160->136|160->136|160->136|164->140|164->140|164->140|178->154|178->154|178->154|182->158|182->158|182->158|183->159|184->160|184->160|184->160|185->161|186->162|186->162|186->162|195->171|195->171|195->171|197->173|197->173|197->173|198->174|198->174|198->174|199->175|199->175|199->175|204->180|204->180|204->180|205->181|206->182|206->182|206->182|207->183|208->184|208->184|208->184|232->208|232->208|233->209|234->210|234->210|239->215|239->215|240->216|241->217|241->217 - -- GENERATED -- - */ - \ No newline at end of file diff --git a/deeplearning4j/deeplearning4j-ui-parent/deeplearning4j-play/src/main/scala/org/deeplearning4j/ui/views/html/training/TrainingSystem.template.scala b/deeplearning4j/deeplearning4j-ui-parent/deeplearning4j-play/src/main/scala/org/deeplearning4j/ui/views/html/training/TrainingSystem.template.scala deleted file mode 100644 index 9ca429f48..000000000 --- a/deeplearning4j/deeplearning4j-ui-parent/deeplearning4j-play/src/main/scala/org/deeplearning4j/ui/views/html/training/TrainingSystem.template.scala +++ /dev/null @@ -1,349 +0,0 @@ - -/******************************************************************************* - * Copyright (c) 2015-2019 Skymind, Inc. - * - * This program and the accompanying materials are made available under the - * terms of the Apache License, Version 2.0 which is available at - * https://www.apache.org/licenses/LICENSE-2.0. - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT - * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the - * License for the specific language governing permissions and limitations - * under the License. - * - * SPDX-License-Identifier: Apache-2.0 - ******************************************************************************/ - -package org.deeplearning4j.ui.views.html.training - -import play.twirl.api._ -import play.twirl.api.TemplateMagic._ - - - object TrainingSystem_Scope0 { -import models._ -import controllers._ -import play.api.i18n._ -import views.html._ -import play.api.templates.PlayMagic._ -import play.api.mvc._ -import play.api.data._ - -class TrainingSystem extends BaseScalaTemplate[play.twirl.api.HtmlFormat.Appendable,Format[play.twirl.api.HtmlFormat.Appendable]](play.twirl.api.HtmlFormat) with play.twirl.api.Template1[org.deeplearning4j.ui.api.I18N,play.twirl.api.HtmlFormat.Appendable] { - - /**/ - def apply/*1.2*/(i18n: org.deeplearning4j.ui.api.I18N):play.twirl.api.HtmlFormat.Appendable = { - _display_ { - { - - -Seq[Any](format.raw/*1.40*/(""" -"""),format.raw/*2.1*/(""" - - - - - - - - """),_display_(/*24.17*/i18n/*24.21*/.getMessage("train.pagetitle")),format.raw/*24.51*/(""" - - - - - - - - - - - - - - - - - - - - - -
- - - -
- -
- -
-
-

"""),_display_(/*92.41*/i18n/*92.45*/.getMessage("train.system.title")),format.raw/*92.78*/("""

-
- - -
-
-
- - -
-
- - -
- -
-
-

"""),_display_(/*109.61*/i18n/*109.65*/.getMessage("train.system.chart.systemMemoryTitle")),format.raw/*109.116*/(""" """),format.raw/*109.117*/("""%

-
-
-
-

"""),_display_(/*113.75*/i18n/*113.79*/.getMessage("train.system.chart.memoryShort")),format.raw/*113.124*/(""": 0, - """),_display_(/*114.58*/i18n/*114.62*/.getMessage("train.overview.charts.iteration")),format.raw/*114.108*/(""": 0

-
-
- - -
-
-

"""),_display_(/*121.61*/i18n/*121.65*/.getMessage("train.system.chart.gpuMemoryTitle")),format.raw/*121.113*/(""" """),format.raw/*121.114*/("""%

-
-
-
-

"""),_display_(/*125.75*/i18n/*125.79*/.getMessage("train.system.chart.memoryShort")),format.raw/*125.124*/(""": 0, - """),_display_(/*126.58*/i18n/*126.62*/.getMessage("train.overview.charts.iteration")),format.raw/*126.108*/(""": 0

-
-
- -
- - -
- - -
-
-

"""),_display_(/*138.61*/i18n/*138.65*/.getMessage("train.system.hwTable.title")),format.raw/*138.106*/("""

-
-
- - - - - - - - - - - - - - - - - - - - - -
"""),_display_(/*144.70*/i18n/*144.74*/.getMessage("train.system.hwTable.jvmCurrent")),format.raw/*144.120*/(""""""),_display_(/*145.70*/i18n/*145.74*/.getMessage("train.system.hwTable.jvmMax")),format.raw/*145.116*/(""""""),_display_(/*146.70*/i18n/*146.74*/.getMessage("train.system.hwTable.offHeapCurrent")),format.raw/*146.124*/(""""""),_display_(/*147.70*/i18n/*147.74*/.getMessage("train.system.hwTable.offHeapMax")),format.raw/*147.120*/(""""""),_display_(/*148.70*/i18n/*148.74*/.getMessage("train.system.hwTable.jvmProcs")),format.raw/*148.118*/(""""""),_display_(/*149.70*/i18n/*149.74*/.getMessage("train.system.hwTable.computeDevices")),format.raw/*149.124*/("""
Loading...Loading...Loading...Loading...Loading...Loading...
-
-
- -
- -
- - -
-
-

"""),_display_(/*173.61*/i18n/*173.65*/.getMessage("train.system.swTable.title")),format.raw/*173.106*/("""

-
-
- - - - - - - - - - - - - - - - - - - - - - - -
"""),_display_(/*179.70*/i18n/*179.74*/.getMessage("train.system.swTable.hostname")),format.raw/*179.118*/(""""""),_display_(/*180.70*/i18n/*180.74*/.getMessage("train.system.swTable.os")),format.raw/*180.112*/(""""""),_display_(/*181.70*/i18n/*181.74*/.getMessage("train.system.swTable.osArch")),format.raw/*181.116*/(""""""),_display_(/*182.70*/i18n/*182.74*/.getMessage("train.system.swTable.jvmName")),format.raw/*182.117*/(""""""),_display_(/*183.70*/i18n/*183.74*/.getMessage("train.system.swTable.jvmVersion")),format.raw/*183.120*/(""""""),_display_(/*184.70*/i18n/*184.74*/.getMessage("train.system.swTable.nd4jBackend")),format.raw/*184.121*/(""""""),_display_(/*185.70*/i18n/*185.74*/.getMessage("train.system.swTable.nd4jDataType")),format.raw/*185.122*/("""
Loading...Loading...Loading...Loading...Loading...Loading...Loading...
-
-
- -
- - """),format.raw/*205.73*/(""" - """),format.raw/*206.82*/(""" - """),format.raw/*207.73*/(""" - """),format.raw/*208.79*/(""" - """),format.raw/*209.88*/(""" - """),format.raw/*210.59*/(""" - """),format.raw/*211.78*/(""" - """),format.raw/*212.92*/(""" - """),format.raw/*213.68*/(""" - """),format.raw/*214.69*/(""" - """),format.raw/*215.79*/(""" - """),format.raw/*216.70*/(""" - """),format.raw/*217.69*/(""" - """),format.raw/*218.68*/(""" - """),format.raw/*219.69*/(""" - """),format.raw/*220.108*/(""" - """),format.raw/*221.70*/(""" - """),format.raw/*222.69*/(""" - """),format.raw/*223.65*/(""" - """),format.raw/*224.59*/(""" - """),format.raw/*225.55*/(""" - """),format.raw/*226.51*/(""" - """),format.raw/*227.37*/("""
- -
-
-
- -
-
-
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -""")) - } - } - } - - def render(i18n:org.deeplearning4j.ui.api.I18N): play.twirl.api.HtmlFormat.Appendable = apply(i18n) - - def f:((org.deeplearning4j.ui.api.I18N) => play.twirl.api.HtmlFormat.Appendable) = (i18n) => apply(i18n) - - def ref: this.type = this - -} - - -} - -/**/ -object TrainingSystem extends TrainingSystem_Scope0.TrainingSystem - /* - -- GENERATED -- - DATE: Tue May 07 21:39:41 AEST 2019 - SOURCE: c:/DL4J/Git/deeplearning4j/deeplearning4j/deeplearning4j-ui-parent/deeplearning4j-play/src/main/views/org/deeplearning4j/ui/views/training/TrainingSystem.scala.html - HASH: a5fe2fb79cf26f96000f494801fcbb6b9f354dd5 - MATRIX: 600->1|733->39|761->41|1679->932|1692->936|1743->966|2755->1951|2768->1955|2819->1985|2990->2129|3003->2133|3058->2167|3411->2493|3424->2497|3486->2538|3991->3015|4005->3019|4060->3052|4212->3176|4226->3180|4278->3210|4437->3341|4451->3345|4504->3376|4749->3594|4762->3598|4817->3631|4875->3661|6525->5284|6538->5288|6592->5321|6851->5552|6865->5556|6928->5597|6958->5598|7821->6433|7835->6437|7909->6488|7940->6489|8316->6837|8330->6841|8398->6886|8517->6977|8531->6981|8600->7027|9078->7477|9092->7481|9163->7529|9194->7530|9567->7875|9581->7879|9649->7924|9769->8016|9783->8020|9852->8066|10487->8673|10501->8677|10565->8718|11024->9149|11038->9153|11107->9199|11211->9275|11225->9279|11290->9321|11394->9397|11408->9401|11481->9451|11585->9527|11599->9531|11668->9577|11772->9653|11786->9657|11853->9701|11957->9777|11971->9781|12044->9831|13693->11452|13707->11456|13771->11497|14230->11928|14244->11932|14311->11976|14415->12052|14429->12056|14490->12094|14594->12170|14608->12174|14673->12216|14777->12292|14791->12296|14857->12339|14961->12415|14975->12419|15044->12465|15148->12541|15162->12545|15232->12592|15336->12668|15350->12672|15421->12720|16821->14119|16892->14202|16967->14276|17046->14356|17129->14445|17208->14505|17287->14584|17370->14677|17457->14746|17548->14816|17643->14896|17734->14967|17821->15037|17908->15106|17999->15176|18095->15285|18186->15356|18273->15426|18356->15492|18435->15552|18510->15608|18581->15660|18648->15698|20855->17876|20885->17877|20936->17899|21222->18156|21252->18157|21420->18296|21450->18297|21501->18319|21572->18361|21602->18362 - LINES: 20->1|25->1|26->2|48->24|48->24|48->24|70->46|70->46|70->46|72->48|72->48|72->48|78->54|78->54|78->54|88->64|88->64|88->64|89->65|89->65|89->65|90->66|90->66|90->66|93->69|93->69|93->69|94->70|116->92|116->92|116->92|118->94|118->94|118->94|118->94|133->109|133->109|133->109|133->109|137->113|137->113|137->113|138->114|138->114|138->114|145->121|145->121|145->121|145->121|149->125|149->125|149->125|150->126|150->126|150->126|162->138|162->138|162->138|168->144|168->144|168->144|169->145|169->145|169->145|170->146|170->146|170->146|171->147|171->147|171->147|172->148|172->148|172->148|173->149|173->149|173->149|197->173|197->173|197->173|203->179|203->179|203->179|204->180|204->180|204->180|205->181|205->181|205->181|206->182|206->182|206->182|207->183|207->183|207->183|208->184|208->184|208->184|209->185|209->185|209->185|229->205|230->206|231->207|232->208|233->209|234->210|235->211|236->212|237->213|238->214|239->215|240->216|241->217|242->218|243->219|244->220|245->221|246->222|247->223|248->224|249->225|250->226|251->227|286->262|286->262|287->263|293->269|293->269|298->274|298->274|299->275|300->276|300->276 - -- GENERATED -- - */ - \ No newline at end of file diff --git a/deeplearning4j/deeplearning4j-ui-parent/deeplearning4j-play/src/main/scala/org/deeplearning4j/ui/views/html/tsne/Tsne.template.scala b/deeplearning4j/deeplearning4j-ui-parent/deeplearning4j-play/src/main/scala/org/deeplearning4j/ui/views/html/tsne/Tsne.template.scala deleted file mode 100644 index e9a1225e8..000000000 --- a/deeplearning4j/deeplearning4j-ui-parent/deeplearning4j-play/src/main/scala/org/deeplearning4j/ui/views/html/tsne/Tsne.template.scala +++ /dev/null @@ -1,296 +0,0 @@ - -/******************************************************************************* - * Copyright (c) 2015-2019 Skymind, Inc. - * - * This program and the accompanying materials are made available under the - * terms of the Apache License, Version 2.0 which is available at - * https://www.apache.org/licenses/LICENSE-2.0. - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT - * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the - * License for the specific language governing permissions and limitations - * under the License. - * - * SPDX-License-Identifier: Apache-2.0 - ******************************************************************************/ - -package org.deeplearning4j.ui.views.html.tsne - -import play.twirl.api._ -import play.twirl.api.TemplateMagic._ - - - object Tsne_Scope0 { -import models._ -import controllers._ -import play.api.i18n._ -import views.html._ -import play.api.templates.PlayMagic._ -import play.api.mvc._ -import play.api.data._ - -class Tsne extends BaseScalaTemplate[play.twirl.api.HtmlFormat.Appendable,Format[play.twirl.api.HtmlFormat.Appendable]](play.twirl.api.HtmlFormat) with play.twirl.api.Template0[play.twirl.api.HtmlFormat.Appendable] { - - /**/ - def apply():play.twirl.api.HtmlFormat.Appendable = { - _display_ { - { - - -Seq[Any](format.raw/*1.1*/(""" - - - - - - - T-SNE renders - - - - - - - - """),format.raw/*30.69*/(""" - """),format.raw/*31.9*/(""" - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
DeepLearning4j UI  Available sessions: - -  
- -
-
-
-
-
-
-
-
-
Upload a file to UI server.
-
-
- - - - -
-
-
- - """),format.raw/*219.53*/(""" - """),format.raw/*220.96*/(""" - """),format.raw/*221.42*/(""" - """),format.raw/*222.59*/(""" - """),format.raw/*223.68*/(""" - """),format.raw/*224.27*/(""" - """),format.raw/*225.23*/(""" - """),format.raw/*226.9*/("""
- - -""")) - } - } - } - - def render(): play.twirl.api.HtmlFormat.Appendable = apply() - - def f:(() => play.twirl.api.HtmlFormat.Appendable) = () => apply() - - def ref: this.type = this - -} - - -} - -/**/ -object Tsne extends Tsne_Scope0.Tsne - /* - -- GENERATED -- - DATE: Tue May 07 21:39:41 AEST 2019 - SOURCE: c:/DL4J/Git/deeplearning4j/deeplearning4j/deeplearning4j-ui-parent/deeplearning4j-play/src/main/views/org/deeplearning4j/ui/views/tsne/Tsne.scala.html - HASH: 9c47ea63f8745ed1b8d2d67657f185532c1a0c78 - MATRIX: 634->0|1937->1335|1974->1345|2608->1951|2637->1952|2679->1966|2801->2061|2830->2062|2869->2074|2904->2081|2933->2082|2975->2096|3162->2256|3191->2257|3230->2269|3268->2279|3297->2280|3339->2294|3461->2389|3490->2390|3529->2402|3562->2407|3591->2408|3633->2422|3791->2553|3820->2554|3859->2566|3893->2572|3922->2573|3964->2587|4079->2675|4108->2676|4147->2688|4182->2695|4211->2696|4253->2710|4307->2737|4336->2738|4375->2750|4406->2753|4435->2754|4477->2768|4567->2831|4596->2832|4635->2844|4667->2848|4696->2849|4738->2863|4900->2998|4929->2999|4968->3011|5002->3017|5031->3018|5074->3032|5124->3054|5154->3055|5194->3067|5228->3072|5258->3073|5301->3087|5423->3181|5453->3182|5491->3192|5588->3260|5618->3261|5661->3275|5729->3314|5759->3315|5806->3333|6092->3590|6122->3591|6191->3631|6221->3632|6268->3650|6341->3694|6371->3695|6422->3717|6590->3856|6620->3857|6675->3883|6971->4150|7001->4151|7060->4181|7148->4240|7178->4241|7229->4263|7259->4264|7312->4288|7481->4428|7511->4429|7564->4453|7594->4454|7645->4476|7742->4544|7772->4545|7815->4559|7845->4560|7924->4610|7954->4611|8001->4629|8037->4636|8067->4637|8118->4659|8284->4796|8314->4797|8354->4808|8384->4809|8516->4912|8546->4913|8601->4939|8718->5027|8748->5028|8849->5100|8879->5101|8934->5127|9106->5270|9136->5271|9183->5289|9213->5290|9258->5306|9288->5307|9330->5321|9360->5322|11465->7438|11512->7535|11559->7578|11610->7638|11661->7707|11708->7735|11751->7759|11789->7769 - LINES: 25->1|54->30|55->31|74->50|74->50|75->51|78->54|78->54|80->56|80->56|80->56|81->57|86->62|86->62|88->64|88->64|88->64|89->65|92->68|92->68|94->70|94->70|94->70|95->71|99->75|99->75|101->77|101->77|101->77|102->78|105->81|105->81|107->83|107->83|107->83|108->84|109->85|109->85|111->87|111->87|111->87|112->88|114->90|114->90|116->92|116->92|116->92|117->93|121->97|121->97|123->99|123->99|123->99|124->100|125->101|125->101|127->103|127->103|127->103|128->104|131->107|131->107|132->108|135->111|135->111|136->112|136->112|136->112|137->113|143->119|143->119|145->121|145->121|146->122|146->122|146->122|147->123|149->125|149->125|150->126|152->128|152->128|153->129|154->130|154->130|155->131|155->131|157->133|161->137|161->137|161->137|161->137|162->138|164->140|164->140|165->141|165->141|168->144|168->144|169->145|169->145|169->145|170->146|173->149|173->149|173->149|173->149|175->151|175->151|176->152|178->154|178->154|179->155|179->155|180->156|183->159|183->159|184->160|184->160|185->161|185->161|188->164|188->164|243->219|244->220|245->221|246->222|247->223|248->224|249->225|250->226 - -- GENERATED -- - */ - \ No newline at end of file diff --git a/deeplearning4j/deeplearning4j-ui-parent/deeplearning4j-play/src/main/views/org/deeplearning4j/ui/views/samediff/SameDiffUI.scala.html b/deeplearning4j/deeplearning4j-ui-parent/deeplearning4j-play/src/main/views/org/deeplearning4j/ui/views/samediff/SameDiffUI.scala.html deleted file mode 100644 index 3b5a79cc1..000000000 --- a/deeplearning4j/deeplearning4j-ui-parent/deeplearning4j-play/src/main/views/org/deeplearning4j/ui/views/samediff/SameDiffUI.scala.html +++ /dev/null @@ -1,172 +0,0 @@ -@() - - - - - - - - - SameDiff Graph Visualization - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - @*
*@ -
- - -
- - @*
*@ -
- @*
*@ -
-
- -
-
[No File Loaded]
-
- -
- - @*
*@ -
-
Selected Node:
-
(None)
-
- -
- -
-
- Find Node:
-
- -
- -
-
- -
- - @*
*@ -
-

- Graph Layout: -
- - - - -
-
-
-
-
-
- - -
-
-
-
-
- - - - - - diff --git a/deeplearning4j/deeplearning4j-ui-parent/deeplearning4j-play/src/test/java/org/deeplearning4j/ui/play/TestSameDiffUI.java b/deeplearning4j/deeplearning4j-ui-parent/deeplearning4j-play/src/test/java/org/deeplearning4j/ui/play/TestSameDiffUI.java deleted file mode 100644 index b5af4c88e..000000000 --- a/deeplearning4j/deeplearning4j-ui-parent/deeplearning4j-play/src/test/java/org/deeplearning4j/ui/play/TestSameDiffUI.java +++ /dev/null @@ -1,96 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2015-2019 Skymind, Inc. - * - * This program and the accompanying materials are made available under the - * terms of the Apache License, Version 2.0 which is available at - * https://www.apache.org/licenses/LICENSE-2.0. - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT - * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the - * License for the specific language governing permissions and limitations - * under the License. - * - * SPDX-License-Identifier: Apache-2.0 - ******************************************************************************/ - -package org.deeplearning4j.ui.play; - -import org.deeplearning4j.ui.api.UIServer; -import org.junit.Ignore; -import org.junit.Test; -import org.nd4j.autodiff.samediff.SDVariable; -import org.nd4j.autodiff.samediff.SameDiff; -import org.nd4j.graph.ui.LogFileWriter; -import org.nd4j.linalg.api.buffer.DataType; -import org.nd4j.linalg.api.ndarray.INDArray; -import org.nd4j.linalg.factory.Nd4j; - -import java.io.File; -import java.util.Arrays; - -@Ignore -public class TestSameDiffUI { - - @Ignore - @Test - public void testSameDiff() throws Exception { - -// -// File f = new File("C:/Temp/SameDiffUI/ui_data.bin"); -// f.getParentFile().mkdirs(); -// f.delete(); -// -// SameDiff sd = SameDiff.create(); -// SDVariable in = sd.placeHolder("in", DataType.FLOAT, -1, 3); -// SDVariable w = sd.var("w", DataType.FLOAT, 3,4); -// SDVariable b = sd.var("b", DataType.FLOAT, 1, 4); -// -// SDVariable z = in.mmul(w).add(b); -// SDVariable a = sd.nn().tanh(z); -// -// LogFileWriter lfw = new LogFileWriter(f); -// lfw.writeGraphStructure(sd); -// lfw.writeFinishStaticMarker(); -// -// //Append a number of events -// lfw.registerEventName("accuracy"); -// lfw.registerEventName("precision"); -// long t = System.currentTimeMillis(); -// for( int iter=0; iter<50; iter++) { -// double d = Math.cos(0.1*iter); -// d *= d; -// lfw.writeScalarEvent("accuracy", t + iter, iter, 0, d); -// -// double prec = Math.min(0.05 * iter, 1.0); -// lfw.writeScalarEvent("precision", t+iter, iter, 0, prec); -// } -// -// //Add some histograms: -// lfw.registerEventName("histogramDiscrete"); -// lfw.registerEventName("histogramEqualSpacing"); -// lfw.registerEventName("histogramCustomBins"); -// for( int i=0; i<3; i++ ){ -// INDArray discreteY = Nd4j.createFromArray(0, 1, 2); -// lfw.writeHistogramEventDiscrete("histogramDiscrete", t+i, i, 0, Arrays.asList("zero", "one", "two"), discreteY); -// -// INDArray eqSpacingY = Nd4j.createFromArray(-0.5 + 0.5 * i, 0.75 * i + i, 1.0 * i + 1.0); -// lfw.writeHistogramEventEqualSpacing("histogramEqualSpacing", t+i, i, 0, 0.0, 1.0, eqSpacingY); -// -// INDArray customBins = Nd4j.createFromArray(new double[][]{ -// {0.0, 0.5, 0.9}, -// {0.2, 0.55, 1.0} -// }); -// System.out.println(Arrays.toString(customBins.data().asFloat())); -// System.out.println(customBins.shapeInfoToString()); -// lfw.writeHistogramEventCustomBins("histogramCustomBins", t+i, i, 0, customBins, eqSpacingY); -// } - - - UIServer uiServer = UIServer.getInstance(); - - - Thread.sleep(1_000_000_000); - } - -} diff --git a/deeplearning4j/deeplearning4j-ui-parent/deeplearning4j-ui-standalone/pom.xml b/deeplearning4j/deeplearning4j-ui-parent/deeplearning4j-ui-standalone/pom.xml index e46ec021e..654e34dc1 100644 --- a/deeplearning4j/deeplearning4j-ui-parent/deeplearning4j-ui-standalone/pom.xml +++ b/deeplearning4j/deeplearning4j-ui-parent/deeplearning4j-ui-standalone/pom.xml @@ -134,7 +134,7 @@ org.deeplearning4j - deeplearning4j-ui_2.11 + deeplearning4j-ui ${deeplearning4j.version} diff --git a/deeplearning4j/deeplearning4j-ui-parent/deeplearning4j-ui/pom.xml b/deeplearning4j/deeplearning4j-ui-parent/deeplearning4j-ui/pom.xml index 087466efc..d829971b4 100644 --- a/deeplearning4j/deeplearning4j-ui-parent/deeplearning4j-ui/pom.xml +++ b/deeplearning4j/deeplearning4j-ui-parent/deeplearning4j-ui/pom.xml @@ -1,5 +1,6 @@ - @@ -25,165 +24,43 @@ 4.0.0 - deeplearning4j-play_2.11 - deeplearning4j-play - - - - 2.11.12 - 2.11 - - - - - - buildUiTemplates - - false - - - - - com.google.code.play2-maven-plugin - play2-maven-plugin - ${maven-play2-plugin.version} - - - - - GenerateTemplates - compile - - - - template-compile - - - - - - - - maven-resources-plugin - ${maven-resources-plugin.version} - - - CopyTemplates - compile - - copy-resources - - - ${basedir}/src/main/scala/org/deeplearning4j/ui/views/html - - - ${basedir}/target/twirl/main/org/deeplearning4j/ui/views/html - true - - - - - - - - - - - - test-nd4j-native - - - org.nd4j - nd4j-native - ${project.version} - test - - - - - - test-nd4j-cuda-10.1 - - - org.nd4j - nd4j-cuda-10.1 - ${project.version} - test - - - - + deeplearning4j-vertx + + io.vertx + vertx-core + ${vertx.version} + + + + io.vertx + vertx-web + ${vertx.version} + + + + org.deeplearning4j + deeplearning4j-core + ${project.version} + + org.deeplearning4j deeplearning4j-ui-model ${project.version} + - javax.ws.rs - javax.ws.rs-api - ${ws.rs.version} - - - org.scala-lang - scala-library - ${scala.version} - - - org.scala-lang - scala-reflect - ${scala.version} - - - com.typesafe.play - play-java_2.11 - ${playframework.version} - - - com.google.code.findbugs - jsr305 - - - org.slf4j - jul-to-slf4j - - - org.slf4j - jcl-over-slf4j - - - net.jodah - typetools - - + ch.qos.logback + logback-classic + test - net.jodah - typetools - ${jodah.typetools.version} - - - - com.typesafe.play - play-netty-server_2.11 - ${playframework.version} - - - - org.fusesource.leveldbjni - leveldbjni-all - ${leveldb.version} + org.freemarker + freemarker + 2.3.29 @@ -192,24 +69,8 @@ ${jcommander.version} - - ch.qos.logback - logback-classic - compile - - - org.slf4j - jul-to-slf4j - compile - 1.7.21 - - - - junit - junit - test - + @@ -306,11 +167,6 @@ cytoscape-cola 2.3.0 - - org.webjars.npm - webcola - 3.1.3 - org.webjars.npm cytoscape-cose-bilkent @@ -442,68 +298,8 @@ flatbuffers 1.9.0 - - - - javax.xml.bind - jaxb-api - ${jaxb.version} - provided - - - - - - net.alchim31.maven - scala-maven-plugin - - ${scala.version} - - - - - - org.codehaus.mojo - build-helper-maven-plugin - - - add-source - compile - - add-source - - - - src/main/scala - src/main/java - src/main/views - - - - - - - - com.google.code.sbt-compiler-maven-plugin - sbt-compiler-maven-plugin - ${sbt-compiler-maven-plugin.version} - - - - - org.apache.maven.plugins - maven-compiler-plugin - - 1.8 - 1.8 - - - - - - - @**@ diff --git a/deeplearning4j/deeplearning4j-ui-parent/deeplearning4j-vertx/src/main/resources/templates/SameDiffUI.html b/deeplearning4j/deeplearning4j-ui-parent/deeplearning4j-vertx/src/main/resources/templates/SameDiffUI.html new file mode 100644 index 000000000..1d29f7827 --- /dev/null +++ b/deeplearning4j/deeplearning4j-ui-parent/deeplearning4j-vertx/src/main/resources/templates/SameDiffUI.html @@ -0,0 +1,169 @@ + + + + + + + + + SameDiff Graph Visualization + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + +
+ +
+
+
+ +
+
[No File Loaded]
+
+ +
+ +
+
Selected Node:
+
(None)
+
+ +
+ +
+
+ Find Node:
+
+ +
+ +
+
+ +
+ +
+

+ Graph Layout: +
+ + + + +
+
+
+
+
+
+ + +
+
+
+
+
+ + + + + + \ No newline at end of file diff --git a/deeplearning4j/deeplearning4j-ui-parent/deeplearning4j-play/src/main/views/org/deeplearning4j/ui/views/training/TrainingModel.scala.html b/deeplearning4j/deeplearning4j-ui-parent/deeplearning4j-vertx/src/main/resources/templates/TrainingModel.html.ftl similarity index 85% rename from deeplearning4j/deeplearning4j-ui-parent/deeplearning4j-play/src/main/views/org/deeplearning4j/ui/views/training/TrainingModel.scala.html rename to deeplearning4j/deeplearning4j-ui-parent/deeplearning4j-vertx/src/main/resources/templates/TrainingModel.html.ftl index 81a63d26a..af302e14d 100644 --- a/deeplearning4j/deeplearning4j-ui-parent/deeplearning4j-play/src/main/views/org/deeplearning4j/ui/views/training/TrainingModel.scala.html +++ b/deeplearning4j/deeplearning4j-ui-parent/deeplearning4j-vertx/src/main/resources/templates/TrainingModel.html.ftl @@ -1,4 +1,3 @@ -@(i18n: org.deeplearning4j.ui.api.I18N)
-

@i18n.getMessage("train.overview.perftable.title")

+

${train\.overview\.perftable\.title}

- + - + - + - + - + - + - + - + - +
@i18n.getMessage("train.overview.modeltable.modeltype")${train\.overview\.modeltable\.modeltype} Loading...
@i18n.getMessage("train.overview.modeltable.nLayers")${train\.overview\.modeltable\.nLayers} Loading...
@i18n.getMessage("train.overview.modeltable.nParams")${train\.overview\.modeltable\.nParams} Loading...
@i18n.getMessage("train.overview.perftable.startTime")${train\.overview\.perftable\.startTime} Loading...
@i18n.getMessage("train.overview.perftable.totalRuntime")${train\.overview\.perftable\.totalRuntime} Loading...
@i18n.getMessage("train.overview.perftable.lastUpdate")${train\.overview\.perftable\.lastUpdate} Loading...
@i18n.getMessage("train.overview.perftable.totalParamUpdates")${train\.overview\.perftable\.totalParamUpdates} Loading...
@i18n.getMessage("train.overview.perftable.updatesPerSec")${train\.overview\.perftable\.updatesPerSec} Loading...
@i18n.getMessage("train.overview.perftable.examplesPerSec")${train\.overview\.perftable\.examplesPerSec} Loading...
@@ -151,15 +151,15 @@
-

@i18n.getMessage("train.overview.chart.updateRatioTitle"): log10

+

${train\.overview\.chart\.updateRatioTitle}: log10

-

@i18n.getMessage("train.overview.chart.updateRatioTitleShort") +

${train\.overview\.chart\.updateRatioTitleShort} : 0, log - 10 @i18n.getMessage("train.overview.chart.updateRatioTitleShort") + 10 ${train\.overview\.chart\.updateRatioTitleShort} : 0 - , @i18n.getMessage("train.overview.charts.iteration"): + , ${train\.overview\.charts\.iteration}: 0

@@ -168,20 +168,20 @@
-

@i18n.getMessage("train.overview.chart.stdevTitleShort") +

${train\.overview\.chart\.stdevTitleShort} : 0, log - 10 @i18n.getMessage("train.overview.chart.stdevTitleShort") + 10 ${train\.overview\.chart\.stdevTitleShort} : 0 - , @i18n.getMessage("train.overview.charts.iteration"): + , ${train\.overview\.charts\.iteration}: 0

diff --git a/deeplearning4j/deeplearning4j-ui-parent/deeplearning4j-play/src/main/views/org/deeplearning4j/ui/views/training/TrainingSystem.scala.html b/deeplearning4j/deeplearning4j-ui-parent/deeplearning4j-vertx/src/main/resources/templates/TrainingSystem.html.ftl similarity index 76% rename from deeplearning4j/deeplearning4j-ui-parent/deeplearning4j-play/src/main/views/org/deeplearning4j/ui/views/training/TrainingSystem.scala.html rename to deeplearning4j/deeplearning4j-ui-parent/deeplearning4j-vertx/src/main/resources/templates/TrainingSystem.html.ftl index c68032f51..569fc02b4 100644 --- a/deeplearning4j/deeplearning4j-ui-parent/deeplearning4j-play/src/main/views/org/deeplearning4j/ui/views/training/TrainingSystem.scala.html +++ b/deeplearning4j/deeplearning4j-ui-parent/deeplearning4j-vertx/src/main/resources/templates/TrainingSystem.html.ftl @@ -1,4 +1,3 @@ -@(i18n: org.deeplearning4j.ui.api.I18N)
-

@i18n.getMessage("train.system.chart.gpuMemoryTitle") %

+

${train\.system\.chart\.gpuMemoryTitle} %

-

@i18n.getMessage("train.system.chart.memoryShort"): 0, - @i18n.getMessage("train.overview.charts.iteration"): 0

+

${train\.system\.chart\.memoryShort}: 0, + ${train\.overview\.charts\.iteration}: 0

@@ -135,18 +134,18 @@
-

@i18n.getMessage("train.system.hwTable.title")

+

${train\.system\.hwTable\.title}

- - - - - - + + + + + + @@ -170,19 +169,19 @@
-

@i18n.getMessage("train.system.swTable.title")

+

${train\.system\.swTable\.title}

@i18n.getMessage("train.system.hwTable.jvmCurrent")@i18n.getMessage("train.system.hwTable.jvmMax")@i18n.getMessage("train.system.hwTable.offHeapCurrent")@i18n.getMessage("train.system.hwTable.offHeapMax")@i18n.getMessage("train.system.hwTable.jvmProcs")@i18n.getMessage("train.system.hwTable.computeDevices")${train\.system\.hwTable\.jvmCurrent}${train\.system\.hwTable\.jvmMax}${train\.system\.hwTable\.offHeapCurrent}${train\.system\.hwTable\.offHeapMax}${train\.system\.hwTable\.jvmProcs}${train\.system\.hwTable\.computeDevices}
- - - - - - - + + + + + + + @@ -201,29 +200,6 @@ - - @**@ - @*
*@ - @*
*@ - @*
*@ - @*

GPU Information

*@ - @*
*@ - @*
*@ - @*
@i18n.getMessage("train.system.swTable.hostname")@i18n.getMessage("train.system.swTable.os")@i18n.getMessage("train.system.swTable.osArch")@i18n.getMessage("train.system.swTable.jvmName")@i18n.getMessage("train.system.swTable.jvmVersion")@i18n.getMessage("train.system.swTable.nd4jBackend")@i18n.getMessage("train.system.swTable.nd4jDataType")${train\.system\.swTable\.hostname}${train\.system\.swTable\.os}${train\.system\.swTable\.osArch}${train\.system\.swTable\.jvmName}${train\.system\.swTable\.jvmVersion}${train\.system\.swTable\.nd4jBackend}${train\.system\.swTable\.nd4jDataType}
*@ - @**@ - @**@ - @**@ - @**@ - @**@ - @**@ - @**@ - @**@ - @**@ - @**@ - @*
?
Loading...
*@ - @*
*@ - @*
*@ - @*
*@
diff --git a/deeplearning4j/deeplearning4j-ui-parent/deeplearning4j-play/src/main/views/org/deeplearning4j/ui/views/tsne/Tsne.scala.html b/deeplearning4j/deeplearning4j-ui-parent/deeplearning4j-vertx/src/main/resources/templates/Tsne.html similarity index 91% rename from deeplearning4j/deeplearning4j-ui-parent/deeplearning4j-play/src/main/views/org/deeplearning4j/ui/views/tsne/Tsne.scala.html rename to deeplearning4j/deeplearning4j-ui-parent/deeplearning4j-vertx/src/main/resources/templates/Tsne.html index 5a0cd065c..76e1d7f96 100644 --- a/deeplearning4j/deeplearning4j-ui-parent/deeplearning4j-play/src/main/views/org/deeplearning4j/ui/views/tsne/Tsne.scala.html +++ b/deeplearning4j/deeplearning4j-ui-parent/deeplearning4j-vertx/src/main/resources/templates/Tsne.html @@ -24,11 +24,10 @@ - + - @**@ - + @@ -215,14 +214,6 @@
- - @*
*@ - @*
If a file is already present on the server, specify the path/name.
*@ - @*
*@ - @**@ - @**@ - @*
*@ - @*
*@
diff --git a/deeplearning4j/deeplearning4j-ui-parent/deeplearning4j-play/src/test/java/org/deeplearning4j/ui/play/TestRemoteReceiver.java b/deeplearning4j/deeplearning4j-ui-parent/deeplearning4j-vertx/src/test/java/org/deeplearning4j/ui/TestRemoteReceiver.java similarity index 91% rename from deeplearning4j/deeplearning4j-ui-parent/deeplearning4j-play/src/test/java/org/deeplearning4j/ui/play/TestRemoteReceiver.java rename to deeplearning4j/deeplearning4j-ui-parent/deeplearning4j-vertx/src/test/java/org/deeplearning4j/ui/TestRemoteReceiver.java index eaf6cbcfe..a5469bd1d 100644 --- a/deeplearning4j/deeplearning4j-ui-parent/deeplearning4j-play/src/test/java/org/deeplearning4j/ui/play/TestRemoteReceiver.java +++ b/deeplearning4j/deeplearning4j-ui-parent/deeplearning4j-vertx/src/test/java/org/deeplearning4j/ui/TestRemoteReceiver.java @@ -1,5 +1,6 @@ -/******************************************************************************* +/* ****************************************************************************** * Copyright (c) 2015-2018 Skymind, Inc. + * Copyright (c) 2019 Konduit K.K. * * This program and the accompanying materials are made available under the * terms of the Apache License, Version 2.0 which is available at @@ -14,10 +15,9 @@ * SPDX-License-Identifier: Apache-2.0 ******************************************************************************/ -package org.deeplearning4j.ui.play; +package org.deeplearning4j.ui; import org.deeplearning4j.api.storage.Persistable; -import org.deeplearning4j.api.storage.StatsStorageRouter; import org.deeplearning4j.api.storage.StorageMetaData; import org.deeplearning4j.api.storage.impl.CollectionStatsStorageRouter; import org.deeplearning4j.api.storage.impl.RemoteUIStatsStorageRouter; @@ -40,7 +40,6 @@ import org.nd4j.linalg.activations.Activation; import org.nd4j.linalg.dataset.api.iterator.DataSetIterator; import org.nd4j.linalg.lossfunctions.LossFunctions; -import java.rmi.Remote; import java.util.ArrayList; import java.util.Arrays; import java.util.Collections; @@ -65,19 +64,24 @@ public class TestRemoteReceiver { UIServer s = UIServer.getInstance(); + Thread.sleep(1000); s.enableRemoteListener(collectionRouter, false); try(RemoteUIStatsStorageRouter remoteRouter = new RemoteUIStatsStorageRouter("http://localhost:9000")) { //Use closeable to ensure async thread is shut down SbeStatsReport update1 = new SbeStatsReport(); + update1.setMemoryUsePresent(true); update1.setDeviceCurrentBytes(new long[]{1, 2}); + update1.setDeviceMaxBytes(new long[]{100, 200}); update1.reportIterationCount(10); update1.reportIDs("sid", "tid", "wid", 123456); update1.reportPerformance(10, 20, 30, 40, 50); SbeStatsReport update2 = new SbeStatsReport(); + update2.setMemoryUsePresent(true); update2.setDeviceCurrentBytes(new long[]{3, 4}); + update2.setDeviceMaxBytes(new long[]{300, 400}); update2.reportIterationCount(20); update2.reportIDs("sid2", "tid2", "wid2", 123456); update2.reportPerformance(11, 21, 31, 40, 50); @@ -89,6 +93,9 @@ public class TestRemoteReceiver { SbeStatsInitializationReport init1 = new SbeStatsInitializationReport(); init1.reportIDs("sid", "wid", "tid", 3145253452L); init1.reportHardwareInfo(1, 2, 3, 4, null, null, "2344253"); + init1.setHwDeviceTotalMemory(new long[]{1,2}); + init1.setHwDeviceDescription(new String[]{"d1", "d2"}); + init1.setHasHardwareInfo(true); remoteRouter.putUpdate(update1); Thread.sleep(100); diff --git a/deeplearning4j/deeplearning4j-ui-parent/deeplearning4j-vertx/src/test/java/org/deeplearning4j/ui/TestSameDiffUI.java b/deeplearning4j/deeplearning4j-ui-parent/deeplearning4j-vertx/src/test/java/org/deeplearning4j/ui/TestSameDiffUI.java new file mode 100644 index 000000000..a9da39dbc --- /dev/null +++ b/deeplearning4j/deeplearning4j-ui-parent/deeplearning4j-vertx/src/test/java/org/deeplearning4j/ui/TestSameDiffUI.java @@ -0,0 +1,106 @@ +/* ****************************************************************************** + * Copyright (c) 2015-2019 Skymind, Inc. + * Copyright (c) 2019 Konduit K.K. + * + * This program and the accompanying materials are made available under the + * terms of the Apache License, Version 2.0 which is available at + * https://www.apache.org/licenses/LICENSE-2.0. + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT + * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the + * License for the specific language governing permissions and limitations + * under the License. + * + * SPDX-License-Identifier: Apache-2.0 + ******************************************************************************/ + +package org.deeplearning4j.ui; + +import lombok.extern.slf4j.Slf4j; +import org.deeplearning4j.ui.api.UIServer; +import org.junit.Ignore; +import org.junit.Rule; +import org.junit.Test; +import org.junit.rules.TemporaryFolder; +import org.nd4j.autodiff.samediff.SDVariable; +import org.nd4j.autodiff.samediff.SameDiff; +import org.nd4j.graph.ui.LogFileWriter; +import org.nd4j.linalg.api.buffer.DataType; +import org.nd4j.linalg.api.ndarray.INDArray; +import org.nd4j.linalg.factory.Nd4j; + +import java.io.File; +import java.util.Arrays; + +@Ignore +@Slf4j +public class TestSameDiffUI { + + @Rule + public TemporaryFolder testDir = new TemporaryFolder(); + + + @Ignore + @Test + public void testSameDiff() throws Exception { + File dir = testDir.newFolder(); + File f = new File(dir, "ui_data.bin"); + log.info("File path: {}", f.getAbsolutePath()); + + f.getParentFile().mkdirs(); + f.delete(); + + SameDiff sd = SameDiff.create(); + SDVariable in = sd.placeHolder("in", DataType.FLOAT, -1, 3); + SDVariable w = sd.var("w", DataType.FLOAT, 3,4); + SDVariable b = sd.var("b", DataType.FLOAT, 1, 4); + + SDVariable z = in.mmul(w).add(b); + SDVariable a = sd.nn().tanh(z); + + LogFileWriter lfw = new LogFileWriter(f); + lfw.writeGraphStructure(sd); + lfw.writeFinishStaticMarker(); + + //Append a number of events + lfw.registerEventName("accuracy"); + lfw.registerEventName("precision"); + long t = System.currentTimeMillis(); + for( int iter=0; iter<50; iter++) { + double d = Math.cos(0.1*iter); + d *= d; + lfw.writeScalarEvent("accuracy", LogFileWriter.EventSubtype.EVALUATION, t + iter, iter, 0, d); + + double prec = Math.min(0.05 * iter, 1.0); + lfw.writeScalarEvent("precision", LogFileWriter.EventSubtype.EVALUATION, t+iter, iter, 0, prec); + } + + //Add some histograms: + lfw.registerEventName("histogramDiscrete"); + lfw.registerEventName("histogramEqualSpacing"); + lfw.registerEventName("histogramCustomBins"); + for( int i=0; i<3; i++ ){ + INDArray discreteY = Nd4j.createFromArray(0, 1, 2); + lfw.writeHistogramEventDiscrete("histogramDiscrete", LogFileWriter.EventSubtype.TUNING_METRIC, t+i, i, 0, Arrays.asList("zero", "one", "two"), discreteY); + + INDArray eqSpacingY = Nd4j.createFromArray(-0.5 + 0.5 * i, 0.75 * i + i, 1.0 * i + 1.0); + lfw.writeHistogramEventEqualSpacing("histogramEqualSpacing", LogFileWriter.EventSubtype.TUNING_METRIC, t+i, i, 0, 0.0, 1.0, eqSpacingY); + + INDArray customBins = Nd4j.createFromArray(new double[][]{ + {0.0, 0.5, 0.9}, + {0.2, 0.55, 1.0} + }); + System.out.println(Arrays.toString(customBins.data().asFloat())); + System.out.println(customBins.shapeInfoToString()); + lfw.writeHistogramEventCustomBins("histogramCustomBins", LogFileWriter.EventSubtype.TUNING_METRIC, t+i, i, 0, customBins, eqSpacingY); + } + + + UIServer uiServer = UIServer.getInstance(); + + + Thread.sleep(1_000_000_000); + } + +} diff --git a/deeplearning4j/deeplearning4j-ui-parent/deeplearning4j-play/src/test/java/org/deeplearning4j/ui/play/TestPlayUI.java b/deeplearning4j/deeplearning4j-ui-parent/deeplearning4j-vertx/src/test/java/org/deeplearning4j/ui/TestVertxUI.java similarity index 94% rename from deeplearning4j/deeplearning4j-ui-parent/deeplearning4j-play/src/test/java/org/deeplearning4j/ui/play/TestPlayUI.java rename to deeplearning4j/deeplearning4j-ui-parent/deeplearning4j-vertx/src/test/java/org/deeplearning4j/ui/TestVertxUI.java index b3c3ed5cb..a60147d0f 100644 --- a/deeplearning4j/deeplearning4j-ui-parent/deeplearning4j-play/src/test/java/org/deeplearning4j/ui/play/TestPlayUI.java +++ b/deeplearning4j/deeplearning4j-ui-parent/deeplearning4j-vertx/src/test/java/org/deeplearning4j/ui/TestVertxUI.java @@ -1,5 +1,6 @@ -/******************************************************************************* +/* ****************************************************************************** * Copyright (c) 2015-2018 Skymind, Inc. + * Copyright (c) 2019 Konduit K.K. * * This program and the accompanying materials are made available under the * terms of the Apache License, Version 2.0 which is available at @@ -14,7 +15,7 @@ * SPDX-License-Identifier: Apache-2.0 ******************************************************************************/ -package org.deeplearning4j.ui.play; +package org.deeplearning4j.ui; import org.deeplearning4j.api.storage.StatsStorage; import org.deeplearning4j.datasets.iterator.impl.IrisDataSetIterator; @@ -41,15 +42,13 @@ import org.nd4j.linalg.dataset.api.iterator.DataSetIterator; import org.nd4j.linalg.learning.config.Sgd; import org.nd4j.linalg.lossfunctions.LossFunctions; -import static org.junit.Assert.assertEquals; -import static org.junit.Assert.assertFalse; -import static org.junit.Assert.assertTrue; +import static org.junit.Assert.*; /** * Created by Alex on 08/10/2016. */ @Ignore -public class TestPlayUI { +public class TestVertxUI { @Before public void setUp() throws Exception { UIServer.stopInstance(); @@ -61,14 +60,14 @@ public class TestPlayUI { StatsStorage ss = new InMemoryStatsStorage(); - PlayUIServer uiServer = (PlayUIServer) UIServer.getInstance(); + VertxUIServer uiServer = (VertxUIServer) UIServer.getInstance(); assertEquals(9000, uiServer.getPort()); uiServer.stop(); - PlayUIServer playUIServer = new PlayUIServer(); - playUIServer.runMain(new String[] {"--uiPort", "9100", "-r", "true"}); - - assertEquals(9100, playUIServer.getPort()); - playUIServer.stop(); + VertxUIServer vertxUIServer = new VertxUIServer(); +// vertxUIServer.runMain(new String[] {"--uiPort", "9100", "-r", "true"}); +// +// assertEquals(9100, vertxUIServer.getPort()); +// vertxUIServer.stop(); // uiServer.attach(ss); @@ -249,7 +248,7 @@ public class TestPlayUI { Thread.sleep(100); } - Thread.sleep(100000); + Thread.sleep(1000000); } @Test diff --git a/deeplearning4j/deeplearning4j-ui-parent/deeplearning4j-play/src/test/java/org/deeplearning4j/ui/play/TestPlayUIMultiSession.java b/deeplearning4j/deeplearning4j-ui-parent/deeplearning4j-vertx/src/test/java/org/deeplearning4j/ui/TestVertxUIMultiSession.java similarity index 94% rename from deeplearning4j/deeplearning4j-ui-parent/deeplearning4j-play/src/test/java/org/deeplearning4j/ui/play/TestPlayUIMultiSession.java rename to deeplearning4j/deeplearning4j-ui-parent/deeplearning4j-vertx/src/test/java/org/deeplearning4j/ui/TestVertxUIMultiSession.java index 8d98ac6fc..b640be8c7 100644 --- a/deeplearning4j/deeplearning4j-ui-parent/deeplearning4j-play/src/test/java/org/deeplearning4j/ui/play/TestPlayUIMultiSession.java +++ b/deeplearning4j/deeplearning4j-ui-parent/deeplearning4j-vertx/src/test/java/org/deeplearning4j/ui/TestVertxUIMultiSession.java @@ -1,5 +1,6 @@ -/******************************************************************************* +/* ****************************************************************************** * Copyright (c) 2015-2019 Skymind, Inc. + * Copyright (c) 2019 Konduit K.K. * * This program and the accompanying materials are made available under the * terms of the Apache License, Version 2.0 which is available at @@ -14,8 +15,9 @@ * SPDX-License-Identifier: Apache-2.0 ******************************************************************************/ -package org.deeplearning4j.ui.play; +package org.deeplearning4j.ui; +import io.netty.handler.codec.http.HttpResponseStatus; import org.deeplearning4j.api.storage.StatsStorage; import org.deeplearning4j.datasets.iterator.impl.IrisDataSetIterator; import org.deeplearning4j.nn.api.OptimizationAlgorithm; @@ -34,8 +36,8 @@ import org.junit.Test; import org.nd4j.linalg.activations.Activation; import org.nd4j.linalg.dataset.api.iterator.DataSetIterator; import org.nd4j.linalg.function.Function; +import org.nd4j.linalg.learning.config.Adam; import org.nd4j.linalg.lossfunctions.LossFunctions; -import play.mvc.Http; import java.io.IOException; import java.io.UnsupportedEncodingException; @@ -50,14 +52,14 @@ import static org.junit.Assert.*; * @author Tamas Fenyvesi */ @Ignore -public class TestPlayUIMultiSession { +public class TestVertxUIMultiSession { @Before public void setUp() throws Exception { UIServer.stopInstance(); } @Test - public void testUIMultiSession() { + public void testUIMultiSession() throws Exception { UIServer uIServer = UIServer.getInstance(true, null); HashMap statStorageForThread = new HashMap<>(); @@ -73,6 +75,7 @@ public class TestPlayUIMultiSession { Thread training = new Thread(() -> { int layerSize = sid + 4; MultiLayerConfiguration conf = new NeuralNetConfiguration.Builder() + .updater(new Adam(1e-2)) .optimizationAlgo(OptimizationAlgorithm.STOCHASTIC_GRADIENT_DESCENT).list() .layer(0, new DenseLayer.Builder().activation(Activation.TANH).nIn(4).nOut(layerSize).build()) .layer(1, new OutputLayer.Builder().lossFunction(LossFunctions.LossFunction.MCXENT) @@ -82,7 +85,7 @@ public class TestPlayUIMultiSession { MultiLayerNetwork net = new MultiLayerNetwork(conf); net.init(); - StatsListener statsListener = new StatsListener(ss); + StatsListener statsListener = new StatsListener(ss, 1); statsListener.setSessionID(sessionId); net.setListeners(statsListener, new ScoreIterationListener(1)); @@ -100,6 +103,8 @@ public class TestPlayUIMultiSession { sessionIdForThread.put(training, sessionId); } + Thread.sleep(10000000); + for (Thread thread: statStorageForThread.keySet()) { StatsStorage ss = statStorageForThread.get(thread); String sessionId = sessionIdForThread.get(thread); @@ -112,7 +117,7 @@ public class TestPlayUIMultiSession { HttpURLConnection conn = (HttpURLConnection) new URL(sessionUrl).openConnection(); conn.connect(); - assertEquals(Http.Status.OK, conn.getResponseCode()); + assertEquals(HttpResponseStatus.OK.code(), conn.getResponseCode()); assertTrue(uIServer.isAttached(ss)); } catch (InterruptedException | IOException e) { e.printStackTrace(); @@ -170,7 +175,7 @@ public class TestPlayUIMultiSession { HttpURLConnection conn = (HttpURLConnection) new URL(sessionUrl).openConnection(); conn.connect(); - assertEquals(Http.Status.OK, conn.getResponseCode()); + assertEquals(HttpResponseStatus.OK.code(), conn.getResponseCode()); assertTrue(uIServer.isAttached(statsStorageForSession.get(sessionId))); } } @@ -222,7 +227,7 @@ public class TestPlayUIMultiSession { HttpURLConnection conn = (HttpURLConnection) new URL(sessionUrl).openConnection(); conn.connect(); - assertEquals(Http.Status.OK, conn.getResponseCode()); + assertEquals(HttpResponseStatus.OK.code(), conn.getResponseCode()); assertTrue(uIServer.isAttached(ss)); } @@ -261,7 +266,6 @@ public class TestPlayUIMultiSession { * */ private static class AutoDetachingStatsStorageProvider implements Function { - HashMap storageForSession = new HashMap<>(); UIServer uIServer; long autoDetachTimeoutMillis; @@ -303,5 +307,4 @@ public class TestPlayUIMultiSession { return statsStorage; } } - } diff --git a/deeplearning4j/deeplearning4j-ui-parent/deeplearning4j-play/src/test/resources/logback.xml b/deeplearning4j/deeplearning4j-ui-parent/deeplearning4j-vertx/src/test/resources/logback.xml similarity index 90% rename from deeplearning4j/deeplearning4j-ui-parent/deeplearning4j-play/src/test/resources/logback.xml rename to deeplearning4j/deeplearning4j-ui-parent/deeplearning4j-vertx/src/test/resources/logback.xml index c6f89b60a..2c204cafa 100644 --- a/deeplearning4j/deeplearning4j-ui-parent/deeplearning4j-play/src/test/resources/logback.xml +++ b/deeplearning4j/deeplearning4j-ui-parent/deeplearning4j-vertx/src/test/resources/logback.xml @@ -16,6 +16,8 @@ + + logs/application.log @@ -33,9 +35,10 @@ - - - + + + + diff --git a/deeplearning4j/deeplearning4j-ui-parent/pom.xml b/deeplearning4j/deeplearning4j-ui-parent/pom.xml index 701d73166..678b1c318 100644 --- a/deeplearning4j/deeplearning4j-ui-parent/pom.xml +++ b/deeplearning4j/deeplearning4j-ui-parent/pom.xml @@ -1,6 +1,7 @@ - - 1.8 - 1.8 - - org.apache.maven.plugins @@ -102,6 +94,18 @@ + + + + org.apache.maven.plugins + maven-compiler-plugin + + 1.8 + 1.8 + + + + diff --git a/pom.xml b/pom.xml index f907a58ed..4a0992979 100644 --- a/pom.xml +++ b/pom.xml @@ -350,6 +350,7 @@ 2.8.0 1.2.0-3f79e055 4.10.0 + 3.8.3 1.10.0 1.14.0