Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Adding support for (1) rectangular images and (2) user-defined linking and feeding weight matrices #259

Closed
madratman opened this issue Oct 22, 2015 · 4 comments
Labels
Enhancement Tasks related to enhancement and development

Comments

@madratman
Copy link

(Maybe this should be broken into two issues)

  • To use GRID_FOUR or GRID_EIGHT type connectivity, one needs to restrict to a perfect square number of (pcnn at least) oscillators.
    This restrics the scope of the library(at least pcnn, which I am using) to (cropped) square images.
    Here's the relevant code block from network.cpp:
void network::create_grid_four_connections() {
    const double conv_side_size = std::sqrt((double) num_osc);
    if (conv_side_size - std::floor(conv_side_size) > 0) {
        throw std::runtime_error("Invalid number of oscillators in the network for the grid structure");
    }

And of course, making type GRID_EIGHT calls the previous method only. code block

https://github.com/annoviko/pyclustering/blob/master/ccore/ccore/network.cpp#L236
  • The feeding and linking weight "matrix" in pcnn (haven't checked out other networks) is defined just as a single integer. Hence one can only have an array of equal weights.
    This should be improved to allow users to define custom linkages like gaussian, or inverse of distance.
    [code block 1](https://github.com/annoviko/pyclustering/blob/master/ccore/ccore/pcnn.h#L34 -L35)
typedef struct pcnn_parameters {
...
    double W = 1.0;
    double M = 1.0;

code block 2


        for (std::vector<unsigned int>::const_iterator iter = neighbors.begin(); iter != neighbors.end(); iter++) {
            const double output_neighbor = m_oscillators[(*iter)].output;

            feeding_influence += output_neighbor * m_params.M;
            linking_influence += output_neighbor * m_params.W;
        }
@madratman madratman changed the title A modified PCNN (adding methods to pcnn.cpp) Adding support for (1) rectangular images and (2) user-defined linking and feeding weight matrices Oct 23, 2015
@madratman madratman reopened this Oct 23, 2015
@annoviko annoviko added enhancement Enhancement Tasks related to enhancement and development labels Oct 23, 2015
@annoviko
Copy link
Owner

I think the first part of the issue has been resolved:
eab634c

Thank you for your pull request. It has been merged with some changes: added the same support to other oscillatory networks, added unit-tests.

@annoviko
Copy link
Owner

Anyway such feature (the first part) should be also added to the pyclustering (python) implementation. I will take care about it.

@annoviko
Copy link
Owner

Support of rectangular structures and images by base class network and PCNN is implemented: d9dde07 .

@annoviko
Copy link
Owner

annoviko commented Jun 2, 2016

Support of weight matrices is added. Adjacency class collection can be used for that purpose:

  • adjacency_weight_list
  • adjacency_matrix

Both implement adajcency interface.

@annoviko annoviko closed this as completed Jun 2, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Enhancement Tasks related to enhancement and development
Projects
None yet
Development

No branches or pull requests

2 participants