Join GitHub today
GitHub is home to over 50 million developers working together to host and review code, manage projects, and build software together.
Sign upGitHub is where the world builds software
Millions of developers and companies build, ship, and maintain their software on GitHub — the largest and most advanced development platform in the world.
Model Visualization enabled - Resnet & Inception #2368
Conversation
|
Hi, I think this is a very useful feature. Thanks for the contribution! I have some suggestion in my comments. Please check and welcome discussion. |
| @@ -39,7 +39,8 @@ object Options { | |||
| warmupEpoch: Option[Int] = None, | |||
| gradientL2NormThreshold: Option[Double] = None, | |||
| gradientMin: Option[Double] = None, | |||
| gradientMax: Option[Double] = None | |||
| gradientMax: Option[Double] = None, | |||
| visualization: Boolean = true | |||
yiheng
Mar 9, 2018
Contributor
Can we change the visualization:Boolean to something like summary:Option[String] and let user input the visualization summary location? So if user inputs such value, we can save the graph visualization file in that location instead of hard code it in our code; if user doesn't input, it means he/she doesn't want to enable the visualization
Can we change the visualization:Boolean to something like summary:Option[String] and let user input the visualization summary location? So if user inputs such value, we can save the graph visualization file in that location instead of hard code it in our code; if user doesn't input, it means he/she doesn't want to enable the visualization
| @@ -39,7 +39,8 @@ object Options { | |||
| warmupEpoch: Option[Int] = None, | |||
| gradientL2NormThreshold: Option[Double] = None, | |||
| gradientMin: Option[Double] = None, | |||
| gradientMax: Option[Double] = None | |||
| gradientMax: Option[Double] = None, | |||
| visualization: Boolean = true | |||
yiheng
Mar 9, 2018
Contributor
Also please update the ReadMe.md file in the same folder to let user know how to use this new option.
Also please update the ReadMe.md file in the same folder to let user know how to use this new option.
| @@ -39,7 +39,8 @@ object Options { | |||
| warmupEpoch: Option[Int] = None, | |||
| gradientL2NormThreshold: Option[Double] = None, | |||
| gradientMin: Option[Double] = None, | |||
| gradientMax: Option[Double] = None | |||
| gradientMax: Option[Double] = None, | |||
| visualization: Boolean = true | |||
yiheng
Mar 9, 2018
Contributor
I think you may miss the change in the trainParser?
I think you may miss the change in the trainParser?
| @@ -118,6 +120,19 @@ object TrainInceptionV1 { | |||
| if (param.gradientL2NormThreshold.isDefined) { | |||
| optimizer.setGradientClippingByl2Norm(param.gradientL2NormThreshold.get.toFloat) | |||
| } | |||
|
|
|||
| if (param.visualization) { | |||
| val logdir = "bigdlSummary" | |||
yiheng
Mar 9, 2018
Contributor
As mentioned above, can you let user input the logdir instead of hard code one in the code
As mentioned above, can you let user input the logdir instead of hard code one in the code
|
|
||
| if (param.visualization) { | ||
| val logdir = "bigdlSummary" | ||
| val timestamp: Long = System.currentTimeMillis / 1000 |
yiheng
Mar 9, 2018
Contributor
can we convert the timestamp into a more human readable format? I have a similiar change in my local. I use the human readable time as the suffix. For your reference
val sdf = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss")
val timeStamp = sdf.format(new Date())
can we convert the timestamp into a more human readable format? I have a similiar change in my local. I use the human readable time as the suffix. For your reference
val sdf = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss")
val timeStamp = sdf.format(new Date())| optimizer.setValidationSummary(validationSummary) | ||
| optimizer.setTrainSummary(trainSummary) | ||
| model.asInstanceOf[Graph[Float]].saveGraphTopology(logdir) | ||
| //print("class Num "+param.classNumber) |
yiheng
Mar 9, 2018
Contributor
please remove this commented line
please remove this commented line
| @@ -89,11 +91,23 @@ object Train { | |||
| if (param.checkpoint.isDefined) { | |||
| optimizer.setCheckpoint(param.checkpoint.get, Trigger.everyEpoch) | |||
| } | |||
|
|
|||
| if (param.visualization) { | |||
| val logdir = "bigdlSummary" | |||
yiheng
Mar 9, 2018
Contributor
Please check my comments in the above
Please check my comments in the above
| @@ -42,7 +42,8 @@ object Utils { | |||
| momentum: Double = 0.9, | |||
| dampening: Double = 0.0, | |||
| nesterov: Boolean = true, | |||
| graphModel: Boolean = false) | |||
| graphModel: Boolean = false, | |||
| visualization: Boolean = true) | |||
yiheng
Mar 9, 2018
Contributor
please check my comments in the inception code
please check my comments in the inception code
| trainSummary.setSummaryTrigger("Parameters", Trigger.severalIteration(10)) | ||
| optimizer.setValidationSummary(validationSummary) | ||
| optimizer.setTrainSummary(trainSummary) | ||
| model.asInstanceOf[Graph[Float]].saveGraphTopology(logdir) |
yiheng
Mar 9, 2018
Contributor
we should check if this is real a graph model.
if (model.isInstanceOf[Graph[Float]]) ...
we should check if this is real a graph model.
if (model.isInstanceOf[Graph[Float]]) ...

Formed in 2009, the Archive Team (not to be confused with the archive.org Archive-It Team) is a rogue archivist collective dedicated to saving copies of rapidly dying or deleted websites for the sake of history and digital heritage. The group is 100% composed of volunteers and interested parties, and has expanded into a large amount of related projects for saving online and digital history.

What changes were proposed in this pull request?
-Enabled Graph topology, training summaries in tensorboard for Resnet and inception models.
-Added parameter "visualization"
-Added Top5 accuracy capture for Resnet
(Please fill in changes proposed in this patch)
How was this patch tested?
Manual tests
(Please explain how this patch was tested. E.g. unit tests, integration tests, manual tests)
(If it is possible, please attach a screenshot; otherwise, remove this)
Related links or issues (optional)
fixed #2310