Skip to content

Commit

Permalink
trace a single activation follwe by the objective (wip)
Browse files Browse the repository at this point in the history
  • Loading branch information
Julio Jerez committed Nov 2, 2023
1 parent 25b4391 commit 38b78ed
Showing 1 changed file with 32 additions and 0 deletions.
32 changes: 32 additions & 0 deletions newton-4.00/sdk/dBrain/ndBrainLayerConvolutional.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,7 @@ ndBrainLayerConvolutional::ndBrainLayerConvolutional(ndInt32 inputWidth, ndInt32
//Debug(inputWidth, m_inputHeight, inputDepth, kernelSize, numberOfKernels);
//Debug(7, 7, 2, 3, 3);
Debug(4, 4, 2, 2, 3);
//Debug(4, 4, 2, 2, 2);
}
}

Expand Down Expand Up @@ -350,6 +351,37 @@ void ndBrainLayerConvolutional::Debug(ndInt32 width, ndInt32 height, ndInt32 cha
//ndTrace(("b(%d)\n\n", filter));
}

ndTrace(("\n"));
ndInt32 index = 0;
for (ndInt32 filter = 0; filter < filterCount; ++filter)
{
for (ndInt32 y = 0; y < outputWidth; ++y)
{
for (ndInt32 x = 0; x < outputHeight; ++x)
{
ndTrace(("z(%d) = g(y(%d,%d,%d))\n", index, filter, y, x));
index++;
}
}
}

ndTrace(("\n"));
ndTrace(("L2 =\n"));
index = 0;
for (ndInt32 filter = 0; filter < filterCount; ++filter)
{
for (ndInt32 y = 0; y < outputWidth; ++y)
{
ndTrace((" "));
for (ndInt32 x = 0; x < outputHeight; ++x)
{
ndTrace(("1/2 * (z(%d) - k(%d))^2 + ", index, index));
index++;
}
ndTrace(("\n"));
}
}
ndTrace(("\n"));

// print convolutions
ndTrace(("\n"));
Expand Down

0 comments on commit 38b78ed

Please sign in to comment.