Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

GCI "Filter layers that are exclusive to selected frameworks" #418

Merged
merged 28 commits into from
Nov 7, 2018
Merged

GCI "Filter layers that are exclusive to selected frameworks" #418

merged 28 commits into from
Nov 7, 2018

Conversation

ZeroZeroJedenJeden
Copy link
Contributor

Added filters to show/hide layers in layers bar to selected framework.

@thatbrguy
Copy link
Contributor

Hey @ZeroZeroJedenJeden few suggestions before I do a full review.

  • Can you update the instructions in this documentation to add their layer name to your variables?
  • Please share a gif or video demonstrating your feature in the Fabrik Gitter channel.

Copy link
Contributor

@thatbrguy thatbrguy left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@ZeroZeroJedenJeden Excellent work overall, couple of code-wise suggestions:

<div className="form-group pull-right">
<div className="dropdown">
<button id="topbar-icon" className="btn btn-default dropdown-toggle form-control" data-toggle="dropdown">
<span className="glyphicon glyphicon-list-alt" aria-hidden="true"></span>
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
<span className="glyphicon glyphicon-list-alt" aria-hidden="true"></span>
<span className="glyphicon glyphicon-filter" aria-hidden="true"></span>

I think this should look better

);
}
}

// class FilterBar extends React.Component {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please remove comments if you're sure about your changes.

@@ -1310,6 +1311,7 @@ class Content extends React.Component {
<Login setUserId={this.setUserId} setUserName={this.setUserName}></Login>
<h5 className="sidebar-heading insert-layer-title">
<input id="layer-search-input" placeholder="Search for layer"></input>
<FilterBar />
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please resolve the below webpack error (line 1314):

content.js:1314:2  error  Mixed spaces and tabs  no-mixed-spaces-and-tabs

</ul>
</div>
</div>
</div>
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please resolve the below webpack error (lines 96 and 97):

filterbar.js:96:2  error  Mixed spaces and tabs  no-mixed-spaces-and-tabs
filterbar.js:97:2  error  Mixed spaces and tabs  no-mixed-spaces-and-tabs

// </ul>
// </div>
// </div>
// </div>
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please resolve the below webpack error (lines 560 and 561). Just removing the comments would do as well, but mentioning it anyway:

pane.js:560:2  error  Mixed spaces and tabs  no-mixed-spaces-and-tabs
pane.js:561:2  error  Mixed spaces and tabs  no-mixed-spaces-and-tabs

@thatbrguy
Copy link
Contributor

@ZeroZeroJedenJeden That's some excellent work, well done! I have a few comments based on my observations:

  • While using the Keras filter, layers like "Input" and "Convolution" get filtered out. However, those layers are available in Keras. Please check your filter arrays if they are missing/having any irrelevant elements.
  • It would great if you could have the checkmark like: Keras [X] instead of [X] Keras.
  • Currently I have to click the checkmark area to toggle the filter. Can you change it such that clicking anywhere on the Keras [X] dropdown would toggle the filter (Instead of clicking on the checkmark [X])?
  • Your functionality works well in conjunction with the search bar. So that's great!

@Ram81 @yashdusing It'll be great if you guys can review this functionality as well.

@ZeroZeroJedenJeden
Copy link
Contributor Author

  • "Input" and "Convolution" added to filter array.

  • [X] Keras changed to Keras [X]

  • checkmark work on all button area.

  • removed all comented code and removed all error Mixed spaces and tabs no-mixed-spaces-and-tabs errors

@thatbrguy If you can, check the work.

@yashdusing
Copy link
Contributor

The functionality's great. But I think :

  • You should add some margin to filter layer's search bar in the bottom and the top. This looks a little clustered.
  • Try to align the button along with search bar. The search bar takes up both the Insert layer heading's area as well as search bar's. Try to bring it to search bar's level and keep it within that bounds.
    Apart from this : LGTM

@ZeroZeroJedenJeden
Copy link
Contributor Author

@yashdusing I see it, but to do it, I'll modify search bar placing system. Search bar is not my GCI task, so I wait what @thatbrguy will say.

@thatbrguy
Copy link
Contributor

thatbrguy commented Nov 3, 2018

@ZeroZeroJedenJeden Hey, good progress! However there are still some layer discrepancies. For instance, Crop is Caffe only, but is available on Keras and TensorFlow as well. Similarly, LRN is available in Keras, but not displayed. Input is available on TensorFlow, but not displayed as well, and so on.

Please go through data.js and the files in tensorflow_app, keras_app and caffe_app and verify if everything has been accounted for. We'll focus on this for now. If time permits, we can work on @yashdusing's suggestion

@ZeroZeroJedenJeden
Copy link
Contributor Author

My brain has stopped working. I got elements for filter from #409 PR without verification, where Input missing, LRN only for cafee and Crop for all frameworks. I going to rewrite all arrays with official domumentacions.

@ZeroZeroJedenJeden
Copy link
Contributor Author

  • Updated filters from data.js

@ZeroZeroJedenJeden
Copy link
Contributor Author

  • Modifed placing system.

@thatbrguy
Copy link
Contributor

@ZeroZeroJedenJeden Glad that you're actively verifying the layers, good work! @yashdusing Could you verify if the filter functionality has all the proper layers for each framework? I may have missed something.

I got a few points as well:

  • Looks like content.js, pane.js and filterbar.js got added twice in your commits. Please remove the redundancies.
  • Placement looks weird all of a sudden, did you change anything? You can modify it to the older version if you cant fix it. I've attached an image showing the problem below:
    filter

@yashdusing
Copy link
Contributor

I have the same display issue as @thatbrguy so please fix that bug.

@ZeroZeroJedenJeden
Copy link
Contributor Author

ZeroZeroJedenJeden commented Nov 3, 2018

I pushed content.js, pane.js and filterbar.js to master folder. This create this look bug and double files. It should be good now. @thatbrguy If you can, check this.

@thatbrguy
Copy link
Contributor

@ZeroZeroJedenJeden Hello. Yes, placement looks perfect now.

About the layers, @yashdusing and I will verify if everything has been properly added and let you know if something's missing.

@yashdusing
Copy link
Contributor

@ZeroZeroJedenJeden Please look into the comments I've made and fix those. Apart from those comments : LGTM

"Bidirectional_Button", "RepeatVector_Button", "Masking_Button", "Permute_Button", "InnerProduct_Button",
"Deconvolution_Button", "Regularization_Button", "Softsign_Button", "Upsample_Button", "Pooling_Button",
"LocallyConnected_Button", "Input_Button", "Convolution_Button", "LRN_Button", "DepthwiseConv_Button", "Flatten_Button",
"Reshape_Button", "Concat_Button", "Softplus_Button", "HardSigmoid_Button", "Dropout_Button"];
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

https://keras.io/layers/merge/
Also, these correspond to eltwise , I think

"InnerProduct_Button", "Deconvolution_Button", "ELU_Button", "Dropout_Button",
"Pooling_Button", "LocallyConnected_Button", "Sigmoid_Button",
"Convolution_Button", "TanH_Button",
"Input_Button", "Flatten_Button", "Reshape_Button", "Concat_Button"];
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

List of supported TF layers (as per dict) : Input, Convolution, Pooling, DepthwiseConv, InnerProduct, LRN, Concat, Flatten, BatchNorm, DeConv, Sigmoid, Softplus, Softsign, Elu, Relu, Softmax, TanH, Selu, Dropout, Eltwise

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Remove the existing layers and put in these. Also, go through 'import_graphdef.py' once just in case I missed any layers .

"Reshape_Button", "BatchReindex_Button", "Split_Button", "Concat_Button", "Eltwise_Button", "Filter_Button",
"Reduction_Button", "Silence_Button", "ArgMax_Button", "Softmax_Button", "MultinomialLogisticLoss_Button",
"InfogainLoss_Button", "SoftmaxWithLoss_Button", "EuclideanLoss_Button", "HingeLoss_Button",
"SigmoidCrossEntropyLoss_Button", "Accuracy_Button", "ContrastiveLoss_Button", "Data_Button", "Crop_Button"];
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You forgot Threshold Relu, Slice, Python layers. Apart from these, I didn't find any layers that were missed.

@ZeroZeroJedenJeden
Copy link
Contributor Author

@yashdusing So I have problem. I can't find Slice button in pane.js. Does Slice have different name?

@thatbrguy
Copy link
Contributor

@ZeroZeroJedenJeden Looks good to me, excellent work 👍

@Ram81
Copy link
Member

Ram81 commented Nov 5, 2018

@ZeroZeroJedenJeden style gets messed up on chrome, can you fix this.
screen shot 2018-11-05 at 2 24 57 pm

Copy link
Member

@Ram81 Ram81 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@ZeroZeroJedenJeden Minor changes. Functionality wise LGTM

@@ -1308,17 +1309,20 @@ class Content extends React.Component {
/>
<h5 className="sidebar-heading">LOGIN</h5>
<Login setUserId={this.setUserId} setUserName={this.setUserName}></Login>
<h5 className="sidebar-heading">
<div id="insert-layer-sign">INSERT LAYER</div>
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Correct the Indentation

</h5>
<Pane
handleClick = {this.handleClick}
setDraggingLayer = {this.setDraggingLayer}
/>
<div className="text-center">
<Tabs selectedPhase={this.state.selectedPhase} changeNetPhase={this.changeNetPhase} />
<Tabs selectedPhase={this.state.selectedPhase} changeNetPhase={this.changeNetPhase} />
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fix the indentation

"Deconvolution_Button", "Regularization_Button", "Softsign_Button", "Upsample_Button", "Pooling_Button",
"LocallyConnected_Button", "Input_Button", "Convolution_Button", "LRN_Button", "DepthwiseConv_Button", "Flatten_Button",
"Reshape_Button", "Concat_Button", "Softplus_Button", "HardSigmoid_Button", "Dropout_Button", "Eltwise_Button"];
var TensorFlowLayers = ["Input_Button", "Convolution_Button", "Pooling_Button", "DepthwiseConv_Button", "InnerProduct_Button",
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Add a new line above this

"LRN_Button", "Concat_Button", "Flatten_Button", "BatchNorm_Button", "Deconvolution_Button", "Sigmoid_Button",
"Softplus_Button", "Softsign_Button", "ELU_Button", "ReLU_Button", "Softmax_Button", "TanH_Button", "SELU_Button",
"Dropout_Button", "Eltwise_Button"];
var CaffeLayers = ["ImageData_Button", "HDF5Data_Button", "HDF5Output_Button", "Input_Button", "WindowData_Button",
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Add a newline above this

@@ -0,0 +1,103 @@
import React from 'react';
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Rename the file to filterBar.js

var CheckBoxC = document.getElementById("CheckBoxC");
var visible = [];

let CheckBox = document.getElementById(cbid);
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Follow the camel case style for variable names

visible = visible.concat(CaffeLayers);
}

for (let elem of $('.drowpdown-button')) {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Uneven Indentation

</ul>
</div>
</div>
</div>
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Again Indentation fixes

@@ -16,8 +17,8 @@

#layer-search-input {
position: absolute;
top: 36px;
left: 20px;
top: 2px;
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Rather than hardcoding the values you can assign relative values.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@ZeroZeroJedenJeden try using relative values to see if that solves the layout bug

if(id == visible[j]){
elem.classList.remove("hide");
j = visible.length + 1;
}else{
Copy link
Member

@Ram81 Ram81 Nov 5, 2018

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Put else on newline and add space after else

for (let elem of $('.drowpdown-button')) {
for (let j = 0; j < visible.length; j++){
let id = elem.id;
if(id == visible[j]){
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

space after ) and before {

<li>
<a className="btn" onClick={this.changeEvent.bind(this, "CheckBoxA")}>
<label className="filter">Keras</label>
<input type="checkbox" id="CheckBoxA" value="A" onClick={this.changeEvent.bind(this, "CheckBoxA")} />
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Rename checkbox ids to be more specific for functionality

@ZeroZeroJedenJeden
Copy link
Contributor Author

@Ram81 About this "style bug" on chrome. On my chrome all looks good. Try clean chrome cache, like ctrl + R and ctrl + F5 or clean site cache in chrome settings.

@Ram81
Copy link
Member

Ram81 commented Nov 6, 2018

@ZeroZeroJedenJeden the size of filter button still looks to big. Is it same for you?

@ZeroZeroJedenJeden
Copy link
Contributor Author

@Ram81 The size of filter button is the same size as topBar buttons (import, export etc).

@yashdusing
Copy link
Contributor

Hello @ZeroZeroJedenJeden ! It seems that this task is still not yet done and you have simultaneously taken up another task for fixing layer chopiness. We would like you to finish this task up first and have the PR approved before taking up the other one as it violates the rule of taking up more than one tasks at a time.

@ZeroZeroJedenJeden
Copy link
Contributor Author

@yashdusing Right, but after @thatbrguy "LGTM"comment I could take next task on GCI site. I took next task and after this @Ram81 wrote comments to this task.

@yashdusing
Copy link
Contributor

@ZeroZeroJedenJeden sorry for the confusion. I thought that the PR wasn't approved so the task might not have the approval. You can continue your work on the layer chopiness. Ask for help if you're stuck

@ZeroZeroJedenJeden
Copy link
Contributor Author

To @Ram81 big button comment. Are this look better?
image

Copy link
Member

@Ram81 Ram81 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@Ram81 Ram81 merged commit 4b54694 into Cloud-CV:master Nov 7, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants