调试 NEURON MOD 文件?

标签 debugging neural-network neuroscience biological-neural-network neuron-simulator

调试 NEURON 模拟器 .MOD 文件有哪些有用的方法?在其他语言中,通常可以使用 print() 语句来查看变量值。 .MOD 文件中是否有类似 print() 语句的内容?

最佳答案

使用 printf() 语句

例如,在 .MOD 文件内的任何部分中,添加下面的 printf() 语句将打印变量 t、i 和 v 值在模拟过程中评估该部分的时间:

BREAKPOINT {
    SOLVE state METHOD cnexp
    g = (B - A)*gmax
    i = g*(v - e)

    printf("time: %g, current: %g, voltage: %g \n", t, i, v)
}

将产生如下所示的结果:

time: 231.062, current: 0.000609815, voltage: -67.2939 
time: 231.188, current: 0.000609059, voltage: -67.2938 
time: 231.312, current: 0.000608304, voltage: -67.2937 
time: 231.438, current: 0.00060755, voltage: -67.2936 
time: 231.562, current: 0.000606844, voltage: -67.2924 

注释:

  • 添加上述语句后重新编译文件夹中的.mod文件
  • 不要忘记在末尾添加“\n”以避免堆积输出
  • 其他参数选项(%g 除外)可以在 printf() reference 中找到。

关于调试 NEURON MOD 文件?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/36611824/

相关文章:

computer-vision - 深度学习——Conv网络模型之上的微调

python - 如何将函数应用于 pandas 数据框中的每一行?

python - 使用 Nipy 在 python 中下采样 mri T1 图像

node.js - Node JS : Is is possible to show the stack trace of a calling async function?

debugging - 覆盖 DebuggerStepThrough 属性而不删除它

machine-learning - 有 NEAT 上的 Encog 文档吗?

python - 寻找线性循环网络的稳态输出

debugging - 如何调试迭代程序?

使用测试工具调试 Forth

artificial-intelligence - 谷歌深梦艺术 : how to pick a layer in a neural network and enhance it