4630405d8134201e03780a9fb74878e6d39763ee,artificial_neural_networks/network.py,Network,_build_ann,#Network#,53

Before Change


  def _build_ann(self):
    hidden_neurons = 2 * (len(self.inputs) + len(self.languages)) / 3

    self._net = theanets.Classifier([len(self.inputs),
                                     {"size": int(hidden_neurons), "activation": "tanh"},
                                     len(self.languages)])

After Change


    def _build_ann(self):
        hidden_neurons = 2 * (len(self.inputs) + len(self.languages)) / 3

        self._net = Sequential()
        self._net.add(Input(len(self.inputs)))
        self._net.add(Dense(int(hidden_neurons), activation="tanh"))
        self._net.add(Dense(len(self.languages), activation="softmax"))
        self._net.compile(
            loss="categorical_crossentropy", optimizer=Adam(learning_rate=0.01)
Italian Trulli
In pattern: SUPERPATTERN

Frequency: 3

Non-data size: 5

Instances


Project Name: thoughtfulml/examples-in-python
Commit Name: 4630405d8134201e03780a9fb74878e6d39763ee
Time: 2020-07-20
Author: matt@matthewkirk.com
File Name: artificial_neural_networks/network.py
Class Name: Network
Method Name: _build_ann


Project Name: pgmpy/pgmpy
Commit Name: 764b22136f964c50bcf7d30c4f1efe6bdaabd50b
Time: 2014-01-08
Author: ankurankan@gmail.com
File Name: src/BayesianModel/BayesianModel.py
Class Name: BayesianModel
Method Name: _get_ancestors_observation


Project Name: pgmpy/pgmpy
Commit Name: d9213be6d79011721e43444b03d27fe6aaa65071
Time: 2014-01-29
Author: abinash.panda.ece10@itbhu.ac.in
File Name: pgmpy/BayesianModel/BayesianModel.py
Class Name: BayesianModel
Method Name: active_trail_nodes