Skip to content

Commit

Permalink
Modify Network Params
Browse files Browse the repository at this point in the history
  • Loading branch information
AdamYuan committed Apr 2, 2024
1 parent 5162b47 commit 0d59ec4
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 12 deletions.
18 changes: 6 additions & 12 deletions src/CuNRCNetwork.cu
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,11 @@ CuNRCNetwork::CuNRCNetwork() {
{"optimizer",
{
{"otype", "Adam"},
{"learning_rate", 1e-3},
{"learning_rate", 0.002},
{"beta1", 0.9},
{"beta2", 0.999},
{"epsilon", 1e-8},
{"l2_reg", 1e-8},
}},
{"encoding",
{
Expand Down Expand Up @@ -55,17 +59,7 @@ CuNRCNetwork::CuNRCNetwork() {
};
}

void CuNRCNetwork::Reset() {
m_p_cuda_impl->trainer->initialize_params();

/* tcnn::default_rng_t rng{std::random_device{}()};
uint32_t count = kTCNNBlockCount;
tcnn::GPUMatrix<float> inputs(kCuNRCInputDims, count);
tcnn::generate_random_uniform<float>(m_p_cuda_impl->stream, rng, kCuNRCInputDims * count, inputs.data());
tcnn::GPUMatrix<float> targets(kCuNRCOutputDims, count);
tcnn::generate_random_uniform<float>(m_p_cuda_impl->stream, rng, kCuNRCOutputDims * count, targets.data());
m_p_cuda_impl->trainer->training_step(m_p_cuda_impl->stream, inputs, targets); */
}
void CuNRCNetwork::Reset() { m_p_cuda_impl->trainer->initialize_params(); }

void CuNRCNetwork::Inference(const CuVkBuffer &inputs, const CuVkBuffer &outputs, uint32_t count) const {
count = (count + kTCNNBlockCount - 1u) / kTCNNBlockCount * kTCNNBlockCount;
Expand Down
1 change: 1 addition & 0 deletions src/main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -176,6 +176,7 @@ int main(int argc, char **argv) {
fence->Wait();

uint32_t inference_count = vk_nrc_resource->GetInferenceCount(frame_index);
cu_nrc_network->Synchronize();
cu_nrc_network->Inference(*vk_nrc_resource->GetInferenceInputBuffer(),
*vk_nrc_resource->GetInferenceOutputBuffer(), inference_count);
cu_nrc_network->Synchronize();
Expand Down

0 comments on commit 0d59ec4

Please sign in to comment.