Skip to content

Commit

Permalink
📝 Update documentation
Browse files Browse the repository at this point in the history
  • Loading branch information
basedrhys committed Nov 18, 2020
1 parent 9f614e5 commit 8b38797
Show file tree
Hide file tree
Showing 6 changed files with 43 additions and 7 deletions.
4 changes: 2 additions & 2 deletions src/main/java/weka/core/progress/CommandLineProgressBar.java
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,8 @@
import java.util.TimerTask;

@Log4j2
/**
* Command line implementation of a progress bar
/*
Command line implementation of a progress bar
*/
public class CommandLineProgressBar extends AbstractProgressBar {

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,11 @@
import java.util.ArrayList;
import java.util.List;

// TODO document
/**
* Generic class for a saliency map generator.
* Only implemented by ScoreCAM currently so some fields may need to be refactored when implementing a new
* generator method.
*/
public abstract class AbstractCNNSaliencyMapGenerator {

protected ComputationGraph computationGraph = null;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,12 @@
import java.util.Arrays;
import java.util.Enumeration;

// TODO Document

/**
* WEKA Wrapper for a Saliency Map Generator (e.g., ScoreCAM).
* Provides the WEKA handles and getters/setters to control the
* generator from the command line/GUI.
*
*/
@Log4j2
public abstract class AbstractCNNSaliencyMapWrapper implements Serializable, OptionHandler {

Expand Down Expand Up @@ -64,6 +68,7 @@ public void saveResult(BufferedImage completeCompositeImage) {
}
}

@ProgrammaticProperty
public String[] getClassMap() {
return classMap;
}
Expand All @@ -72,6 +77,7 @@ public void setClassMap(String[] classMap) {
this.classMap = classMap;
}

@ProgrammaticProperty
public Dl4jMlpClassifier getDl4jMlpClassifier() {
return dl4jMlpClassifier;
}
Expand All @@ -80,6 +86,7 @@ public void setDl4jMlpClassifier(Dl4jMlpClassifier dl4jMlpClassifier) {
this.dl4jMlpClassifier = dl4jMlpClassifier;
}

@ProgrammaticProperty
public CustomModelSetup getCustomModelSetup() {
return customModelSetup;
}
Expand Down
5 changes: 4 additions & 1 deletion src/main/java/weka/dl4j/interpretability/ScoreCAM.java
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,10 @@
import java.util.ArrayList;
import java.util.Arrays;

// TODO document

/**
*
*/
@Log4j2
public class ScoreCAM extends AbstractCNNSaliencyMapGenerator {

Expand Down
23 changes: 22 additions & 1 deletion src/main/java/weka/dl4j/interpretability/WekaScoreCAM.java
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,28 @@
import java.awt.image.BufferedImage;
import java.io.File;

// TODO Document
/**
* WEKA Wrapper for the Deeplearning4j ScoreCAM implementation.
* <!-- options-start -->
* Valid options are: <p>
*
* <pre> -bs &lt;int&gt;
* The mini batch size to use for map generation</pre>
*
* <pre> -target-classes &lt;int,int,...&gt;
* Output class to generate saliency maps for; default is -1 (use the highest probability class). This only needs to be set if wanting to use a non-default class from the *command line*; if using the *GUI*, the 'View Saliency Map' window contains the interface for setting this.</pre>
*
* <pre> -output &lt;file location&gt;
* File for the saliency map to be saved in</pre>
*
* <pre> -normalize
* When generating the heatmap, should the values be normalized to be in [0, 1]</pre>
*
* <!-- options-end -->
*
* <!-- globalinfo-start -->
* <!-- globalinfo-end -->
*/
@Log4j2
public class WekaScoreCAM extends AbstractCNNSaliencyMapWrapper {

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -421,6 +421,7 @@ public void setTokenizerFactory(TokenizerFactory m_tokenizerFactory) {
commandLineParamSynopsis = "-preprocessor <String>",
displayOrder = 5
)

/**
* Gets the action for the selected preprocessor.
*
Expand Down

0 comments on commit 8b38797

Please sign in to comment.