This is an automated email from the ASF dual-hosted git repository.

paulk pushed a commit to branch asf-site
in repository https://gitbox.apache.org/repos/asf/groovy-website.git


The following commit(s) were added to refs/heads/asf-site by this push:
     new 3a023a3  general tidy up
3a023a3 is described below

commit 3a023a36449af2f1d51ba15743228478980ed4f8
Author: Paul King <[email protected]>
AuthorDate: Fri Feb 17 12:25:05 2023 +1000

    general tidy up
---
 .../blog/classifying-iris-flowers-with-deep.adoc   | 24 ++++++++++++++++------
 .../deep-learning-and-eclipse-collections.adoc     | 20 ++++++++++--------
 2 files changed, 30 insertions(+), 14 deletions(-)

diff --git a/site/src/site/blog/classifying-iris-flowers-with-deep.adoc 
b/site/src/site/blog/classifying-iris-flowers-with-deep.adoc
index 1a4448c..51d05f5 100644
--- a/site/src/site/blog/classifying-iris-flowers-with-deep.adoc
+++ b/site/src/site/blog/classifying-iris-flowers-with-deep.adoc
@@ -340,12 +340,24 @@ user    0m0.096s
 sys     0m0.029s
 ----
 
-We can see here that the speed has dramatically increased. This is great, but 
we should note, that using GraalVM often involves some tricky investigation 
especially for Groovy which by default has its dynamic nature. There are a few 
features of Groovy which won't be available when using Groovy's static nature 
and some libraries might be problematical. As an example, Deep Netts has log4j2 
as one of its dependencies. At the time of writing, there are still issues 
using log4j2 with GraalVM. [...]
-
-(*Update*: I put the Deep Netts GraalVM _iris_ application with some more 
detailed instructions into its own 
https://github.com/paulk-asert/groovy-data-science/tree/master/subprojects/IrisGraalVM[subproject].)
+We can see here that the speed has dramatically increased. This is great,
+but we should note, that using GraalVM often involves some tricky
+investigation especially for Groovy which by default has its dynamic
+nature. There are a few features of Groovy which won't be available
+when using Groovy's static nature and some libraries might be
+problematical. As an example, Deep Netts has log4j2 as one of its
+dependencies. At the time of writing, there are still issues using
+log4j2 with GraalVM. We excluded the `log4j-core` dependency and used
+`log4j-to-slf4j` backed by `logback-classic` to sidestep this problem.
 
 == Conclusion
 
-We have seen a few different libraries for performing deep learning 
classification using Groovy.
-Each has its own strengths and weaknesses.
-There are certainly options to cater for folks wanting blinding fast startup 
speeds through to options which scale to massive computing farms in the cloud.
\ No newline at end of file
+We have seen a few different libraries for performing deep learning 
classification
+using Groovy. Each has its own strengths and weaknesses.
+There are certainly options to cater for folks wanting blinding fast startup 
speeds
+through to options which scale to massive computing farms in the cloud.
+
+.Update history
+****
+*27/Sep/2022*: I put the Deep Netts GraalVM _iris_ application with some more 
detailed instructions into its own 
https://github.com/paulk-asert/groovy-data-science/tree/master/subprojects/IrisGraalVM[subproject].
+****
diff --git a/site/src/site/blog/deep-learning-and-eclipse-collections.adoc 
b/site/src/site/blog/deep-learning-and-eclipse-collections.adoc
index c0c149a..6a9d944 100644
--- a/site/src/site/blog/deep-learning-and-eclipse-collections.adoc
+++ b/site/src/site/blog/deep-learning-and-eclipse-collections.adoc
@@ -11,6 +11,8 @@ Recently, a couple of the highly recommended katas for 
Eclipse Collections have
 revamped to include "pet" and "fruit" emojis for a bit of extra fun. What 
could be better
 than _Learning_ Eclipse Collections?_Deep Learning_ and Eclipse Collections of 
course!
 
+== Setting up our model and data
+
 First, we create a `PetType` enum with the emoji as `toString`:
 
 [source,groovy]
@@ -82,7 +84,9 @@ assert counts == expected
 
 As we expect, it passes.
 
-Now, for a bit of fun, we will use a neural network trained to detect cat and 
dog images and apply it to our emojis. We'll follow the process described 
http://ramok.tech/2018/01/03/java-image-cat-vs-dog-recognizer-with-deep-neural-networks/[here].
 It uses DeepLearning4J to train and then use a model. The images used to train 
the model were real cat and dog images, not emojis, so we aren't expecting our 
model to be super accurate.
+== Applying deep learning
+
+Now, for a bit of fun, we will use a neural network trained to detect cat and 
dog images and apply it to our emojis. We'll follow the process described 
http://ramok.tech/2018/01/03/java-image-cat-vs-dog-recognizer-with-deep-neural-networks/[here].
 It uses https://deeplearning4j.konduit.ai/[Eclipse DeepLearning4j] to train 
and then use a model. The images used to train the model were real cat and dog 
images, not emojis, so we aren't expecting our model to be super accurate.
 
 The first attempt was to write the emojis into swing JLabel components and 
then save using a buffered image. This lead to poor looking images:
 
@@ -122,15 +126,15 @@ Note that the model exceeds the maximum allowable size 
for normal GitHub repos,
 
 When we run the script, we get the following output:
 
-[source]
+[subs="quotes"]
 ----
-[main] INFO org.nd4j.linalg.factory.Nd4jBackend - Loaded [CpuBackend] backend
+[maroon]##[main] INFO org.nd4j.linalg.factory.Nd4jBackend - Loaded 
[CpuBackend] backend
 ...
 [main] INFO org.nd4j.linalg.api.ops.executioner.DefaultOpExecutioner - Blas 
vendor: [OPENBLAS]
 ...
-==============================================================================================================
+==========================================================================================
 VertexName (VertexType)                 nIn,nOut       TotalParams    
ParamsShape                    Vertex Inputs
-==============================================================================================================
+==========================================================================================
 input_1 (InputVertex)                   -,-            -              -        
                      -
 block1_conv1 (Frozen ConvolutionLayer)  3,64           1792           
b:{1,64}, W:{64,3,3,3}         [input_1]
 block1_conv2 (Frozen ConvolutionLayer)  64,64          36928          
b:{1,64}, W:{64,64,3,3}        [block1_conv1]
@@ -154,12 +158,12 @@ flatten (PreprocessorVertex)            -,-            -  
            -
 fc1 (Frozen DenseLayer)                 25088,4096     102764544      
b:{1,4096}, W:{25088,4096}     [flatten]
 fc2 (Frozen DenseLayer)                 4096,4096      16781312       
b:{1,4096}, W:{4096,4096}      [fc1]
 predictions (OutputLayer)               4096,2         8194           b:{1,2}, 
W:{4096,2}            [fc2]
---------------------------------------------------------------------------------------------------------------
+------------------------------------------------------------------------------------------
             Total Parameters:  134268738
         Trainable Parameters:  8194
            Frozen Parameters:  134260544
-==============================================================================================================
-...
+==========================================================================================
+...##
 Tabby is a cat
 Dolly is a cat
 Spot is a dog

Reply via email to