Skip to content

Commit 43d5da4

Browse files
author
Lukas Molzberger
committed
Input -> Synapse.Builder
1 parent 165ea50 commit 43d5da4

35 files changed

+740
-776
lines changed

src/main/java/org/aika/Input.java

Lines changed: 0 additions & 230 deletions
This file was deleted.

src/main/java/org/aika/Model.java

Lines changed: 0 additions & 84 deletions
Original file line numberDiff line numberDiff line change
@@ -262,90 +262,6 @@ private boolean suspend(int docId, Provider<? extends AbstractNode> p, Suspensio
262262
return false;
263263
}
264264

265-
266-
/**
267-
* Creates a neuron with the given bias.
268-
*
269-
* @param n
270-
* @param bias
271-
* @param inputs
272-
* @return
273-
*/
274-
public Neuron initNeuron(Neuron n, double bias, Type type, Input... inputs) {
275-
return initNeuron(n, bias, type, new TreeSet<>(Arrays.asList(inputs)));
276-
}
277-
278-
279-
/**
280-
* Creates a neuron with the given bias.
281-
*
282-
* @param n
283-
* @param bias
284-
* @param inputs
285-
* @return
286-
*/
287-
public Neuron initNeuron(Neuron n, double bias, String activationFunctionKey, Type type, Input... inputs) {
288-
return initNeuron(n, bias, activationFunctionKey, type, new TreeSet<>(Arrays.asList(inputs)));
289-
}
290-
291-
292-
293-
/**
294-
* Creates a neuron with the given bias.
295-
*
296-
* @param n
297-
* @param bias
298-
* @param inputs
299-
* @return
300-
*/
301-
public Neuron initNeuron(Neuron n, double bias, Type type, Collection<Input> inputs) {
302-
return initNeuron(n, bias, null, type, inputs);
303-
}
304-
305-
/**
306-
* Creates a neuron with the given bias.
307-
*
308-
* @param n
309-
* @param bias
310-
* @param inputs
311-
* @return
312-
*/
313-
public Neuron initNeuron(Neuron n, double bias, String activationFunctionKey, Type type, Collection<Input> inputs) {
314-
List<Synapse> is = new ArrayList<>();
315-
316-
for (Input input : inputs) {
317-
Synapse s = input.getSynapse(n);
318-
s.weightDelta = input.weight;
319-
s.biasDelta = input.bias;
320-
is.add(s);
321-
}
322-
323-
if(activationFunctionKey != null) {
324-
ActivationFunction af = activationFunctions.get(activationFunctionKey);
325-
INeuron in = n.get();
326-
in.activationFunction = af;
327-
in.activationFunctionKey = activationFunctionKey;
328-
}
329-
330-
if(type != null) {
331-
INeuron in = n.get();
332-
in.type = type;
333-
}
334-
335-
return INeuron.update(this, defaultThreadId, n, bias, is);
336-
}
337-
338-
339-
public void addSynapse(Neuron n, Input input) {
340-
Synapse s = input.getSynapse(n);
341-
342-
s.weightDelta = input.weight;
343-
s.biasDelta = input.bias;
344-
345-
INeuron.update(this, defaultThreadId, n, 0.0, Collections.singletonList(s));
346-
}
347-
348-
349265
public void removeProvider(Provider p) {
350266
activeProviders.remove(p.id);
351267
providers.remove(p.id);

0 commit comments

Comments
 (0)