+ THIS ACTION WILL DELETE { this.state.selectCount > 1? this.state.selectCount+' LAYERS': 'A LAYER' }
+
+
+
+
+
+
+
+
);
}
}
Canvas.propTypes = {
+ deleteMultipleLayers: React.PropTypes.func,
+ selectedLayers:React.PropTypes.array,
nextLayerId: React.PropTypes.number,
selectedPhase: React.PropTypes.number,
net: React.PropTypes.object.isRequired,
diff --git a/ide/static/js/content.js b/ide/static/js/content.js
index 9a0c92d4c..3c820a15a 100644
--- a/ide/static/js/content.js
+++ b/ide/static/js/content.js
@@ -37,6 +37,7 @@ class Content extends React.Component {
constructor(props) {
super(props);
this.state = {
+ selectedLayers:[],
net: {},
net_name: 'Untitled',
networkId: 0,
@@ -70,6 +71,7 @@ class Content extends React.Component {
this.adjustParameters = this.adjustParameters.bind(this);
this.modifyLayerParams = this.modifyLayerParams.bind(this);
this.deleteLayer = this.deleteLayer.bind(this);
+ this.deleteMultipleLayers = this.deleteMultipleLayers.bind(this);
this.exportPrep = this.exportPrep.bind(this);
this.exportNet = this.exportNet.bind(this);
this.importNet = this.importNet.bind(this);
@@ -488,13 +490,10 @@ class Content extends React.Component {
this.setState({ net });
}
}
- deleteLayer(layerId, publishUpdate=true) {
+ deleteLayer(layerId, publishUpdate=true) {
const net = this.state.net;
const input = net[layerId].connection.input;
const output = net[layerId].connection.output;
- const layerIdNum = parseInt(layerId.substring(1,layerId.length)); //numeric value of the layerId
- const nextLayerId = this.state.nextLayerId - 1 == layerIdNum ? layerIdNum : this.state.nextLayerId;
- //if last layer was deleted nextLayerId is replaced by deleted layer's id
var totalParameters = this.state.totalParameters;
let index;
totalParameters -= this.getLayerParameters(net[layerId], net);
@@ -507,6 +506,14 @@ class Content extends React.Component {
index = net[outputId].connection.input.indexOf(layerId);
net[outputId].connection.input.splice(index, 1);
});
+ let layersIds = Object.keys(net);
+ //if a layer was deleted nextLayerId is replaced by index of last layer id in the net
+ let nextLayerId;
+ if(layersIds[layersIds.length - 1]) {
+ nextLayerId = parseInt(layersIds[layersIds.length - 1].substring(1,layersIds.length))+1;
+ } else {
+ nextLayerId = 0;
+ }
this.setState({ net, selectedLayer: null, nextLayerId: nextLayerId, totalParameters: totalParameters });
// if model is in RTC mode send updates to respective sockets
// to avoid infinite loop of deletion over multiple session
@@ -1113,7 +1120,7 @@ class Content extends React.Component {
here.
Q: What do the Train/Test buttons mean?
- A: They are two different modes of your model:
+ A: They are two different modes of your model:
Train and Test - respectively for training your model with data and testing how and if it works. Q: What does the import fuction do? A: It allows you to import your previously created models in Caffe (.protoxt files),
@@ -1127,7 +1134,7 @@ class Content extends React.Component {
A: Please see the instructions listed
here
-
+
If you have anymore questions, please visit Fabrik's Github page available
here for more information.