def _setup_network_parameters(self): self.ui.layerTypeSelector.addItems(Layers.layers_types()) self.ui.layerTypeSelector.setCurrentIndex( self.ui.layerTypeSelector.findText(Layers.default_layer()) ) self.ui.layersEdit.setValue(len(self.network_model.layers())) for layer in self.network_model.layers(): self.ui.layerComboBox.addItem(layer.layer_name()) self.ui.inputNeuronsEdit.setValue(self.network_model.network_inputs()) self.ui.neuronsEdit.setValue(self.network_model.default_layer().rowCount())
def add_layer(self): layer_name = self._layer_name(len(self.layers_data) + 1) input_neurons = self.input_neurons if len(self.layers_data) != 0: input_neurons = self.layers_data[-1].rowCount() layer_model = LayerModel(layer_name, Layers.default_layer(), NetworkModel.DEFAULT_NEURONS_COUNT, input_neurons, self.minWeight, self.maxWeight) self.layers_data.append(layer_model) return layer_model