ocean::ConnectionModel
大约 3 分钟
ocean::ConnectionModel
连接模型是针对输入及输出间存在随机或任意连接关系的模型基础类 More...
#include <Model.hpp>
Inherits from ocean::Model, ocean::Node, std::enable_shared_from_this< Node >
Inherited by ocean::DendriteGroup, ocean::SynapseGroup
Public Functions
| Name | |
|---|---|
| ConnectionModel(const PIConnectionModel & connectionModel) 构建连接模型 | |
| bool | clear() 清理所有连接关系,对应逻辑关系全部移除 |
| void | traversal(const std::function< bool(uint32_t)> & dealSynapse) 遍历所有连接点,相当于在连接图中连接矩阵的索引位置 |
| uint32_t | getNumber() 获取连接数 |
| uint16_t | getInputNumber() 获取输入数 |
| uint16_t | getOutputNumber() 获取输出数 |
| PIConnectionModel | getConnectionModel() 获取内部模块指针 |
Additional inherited members
Public Functions inherited from ocean::Model
| Name | |
|---|---|
| Model(const PIModel & base) 构造模型, 该方法由模块内部调用 | |
| ~Model() override 模型析构 | |
| float | getStep() 获取计算步长,步长是两次计算间的周期 |
| std::string | getOperation() 获取操作名称 |
| PVariable | getParam(const std::string & paramName) 根据参数名称获取变量 |
| PTensorVariable | getStatus(const std::string & variableName) 据参数名称张量变量 |
| bool | setStatus(const std::string & variableName, const Filler & filler) 根据参数名称设置张量变量 |
| bool | setStatus(const std::string & variableName, const Tensor & status) 根据参数名称设置张量变量 |
| PInput | in(const std::string & name) 根据端口名称获取输入端口 |
| POutput | out(const std::string & name) 根据端口名称获取输出端口 |
| PReference | ref(const std::string & name) 根据端口名称获取引用端口 |
| PConnection | mat(const std::string & name) 根据端口名称获取连接端口 |
| void | addMonitor(const std::string & paramName, float windows =0) 添加变量监控 |
| void | addMonitors(std::vector< std::string > monitors, float windows =0) 批量添加变量监控 |
| void | removeMonitor(const std::string & paramName) 移除变量监控 |
| void | removeMonitors(std::vector< std::string > monitors) 批量删除变量监控 |
| CaptureBuffer | getCapture(const std::string & paramName) 获取变量监控结果 |
| std::vector< CaptureBuffer > | getCaptures(std::vector< std::string > captures) 批量获取变量监控 |
| PIModel | getModel() 获取内部模型指针, 仅被内部模块使用 |
Public Functions inherited from ocean::Node
| Name | |
|---|---|
| Node(PModelBase model) 构造节点 | |
| virtual | ~Node() 节点析构函数 |
| const std::string & | getName() const 获取节点名称 |
| const std::string & | getDescription() const 获取节点描述 |
| void | setDescription(const std::string & description) 设置节点描述 |
| PModelBase | getModelBase() 获取内部基类指针 |
Protected Attributes inherited from ocean::Node
| Name | |
|---|---|
| PModelBase | model 内部模块指针 |
Detailed Description
class ocean::ConnectionModel;
连接模型是针对输入及输出间存在随机或任意连接关系的模型基础类
连接模型主要用于描述输入及输出存在复杂连接关系,如通用突触,延迟突触等;
Public Functions Documentation
function ConnectionModel
explicit ConnectionModel(
const PIConnectionModel & connectionModel
)
构建连接模型
Parameters:
- connectionModel 内部模块指针
Note: 该方法仅由内部模块调用
function clear
bool clear()
清理所有连接关系,对应逻辑关系全部移除
Return:
function traversal
void traversal(
const std::function< bool(uint32_t)> & dealSynapse
)
遍历所有连接点,相当于在连接图中连接矩阵的索引位置
Parameters:
- dealSynapse 处理函数, 返回值尚未使用
案例,如输入数为2,输出数为2的的连接示意图
O----------O
O----------O
输入 输出
连接矩阵为 【1, 0, 0, 1】, 对应的迭代序列为 【0, 3】
function getNumber
uint32_t getNumber()
获取连接数
Return: 连接数
function getInputNumber
uint16_t getInputNumber()
获取输入数
Return: 输入数
function getOutputNumber
uint16_t getOutputNumber()
获取输出数
Return: 输出数
function getConnectionModel
PIConnectionModel getConnectionModel()
获取内部模块指针
Return: 内部模块指针
Note: 仅被内部模块使用
Updated on 2022-08-19 at 17:14:26 +0800