summaryrefslogtreecommitdiffstats
path: root/mixer.c
diff options
context:
space:
mode:
authorJason Linehan <patientulysses@gmail.com>2015-09-01 12:12:39 -0400
committerJason Linehan <patientulysses@gmail.com>2015-09-01 12:12:39 -0400
commitb2be5109167f1e8bc18b18ea71c2159853d5fa39 (patch)
tree7dff45ddd365487664df9de464b8b0f0f8f385ca /mixer.c
parent70a4d1c7c4e3c2bf4a89e6a21bcaa4277db9544d (diff)
downloadhug-b2be5109167f1e8bc18b18ea71c2159853d5fa39.tar.gz
hug-b2be5109167f1e8bc18b18ea71c2159853d5fa39.tar.bz2
hug-b2be5109167f1e8bc18b18ea71c2159853d5fa39.zip
Re-added the large-context modeller... restores idempotence.
Restoring idempotence was ... difficult.
Diffstat (limited to 'mixer.c')
-rw-r--r--mixer.c13
1 files changed, 12 insertions, 1 deletions
diff --git a/mixer.c b/mixer.c
index 317b22e..89038ff 100644
--- a/mixer.c
+++ b/mixer.c
@@ -139,7 +139,7 @@ void nn_init(struct nn_t *nn, int n, int m, int s, int w)
if (nn->S > 1) {
nn->nn_ptr = calloc(sizeof(struct nn_t), 1);
- /* They can operate in a chain, so we recurse here. */
+ /*They can operate in a chain, so we recurse here. */
nn_init(nn->nn_ptr, nn->S, 1, 1, 0x7FFF);
}
}
@@ -167,6 +167,7 @@ void nn_train(struct nn_t *nn, int bit)
err = ((bit<<12) - nn->pr[i])*7;
assert(err >= -32768 && err < 32768);
+ /*printf("err:%d\n", err);*/
/* ASM */
train(&nn->tx[0], &nn->wx[nn->ctx[i] * nn->N], nn->nx, err);
@@ -227,6 +228,16 @@ void nn_set(struct nn_t *nn, int context, int range)
nn->base += range;
}
+void nn_print(struct nn_t *nn)
+{
+ int i;
+ for (i=0; i<nn->nx; i++) {
+ printf("tx[%d]:%d\n", i, nn->tx[i]);
+ }
+ for (i=0; i<nn->nx; i++) {
+ printf("wx[%d]:%d\n", i, nn->wx[i]);
+ }
+}
/**
* nn_predict()