<commit_before>/*
 * Retina.h
 *
 *  Created on: Jul 29, 2008
 *
 */

#ifndef RETINA_HPP_
#define RETINA_HPP_

#include "HyPerLayer.hpp"
#include "fileread.h"

namespace PV
{

class Retina: public PV::HyPerLayer
{
public:
   Retina(const char * name, HyPerCol * hc);
   Retina(const char * name, HyPerCol * hc, const char * filename);

   int init(const char * name, PVLayerType type);
   int setParams(PVParams * params, fileread_params * p, const char * filename);

   virtual int recvSynapticInput(HyPerLayer* lSource, PVLayerCube* cube);
   virtual int updateState(float time, float dt);
   virtual int writeState(const char * path, float time);
   virtual int createImage(pvdata_t * buf);
   virtual int spike(float time, float dt, float prob, float probStim, int * start);

private:

   // For input from a given source input layer, determine which
   // cells in this layer will respond to the input activity.
   // Return the feature vectors for both the input and the sensitive
   // neurons, since most likely we will have to determine those.
   int findPostSynaptic(int dim, int maxSize, int col,
      // input: which layer, which neuron
      HyPerLayer *lSource, float pos[],
      // output: how many of our neurons are connected.
      // an array with their indices.
      // an array with their feature vectors.
      int * nNeurons, int nConnectedNeurons[], float * vPos);

   int calculateWeights(HyPerLayer * lSource, float * pos, float * vPos, float * vfWeights );

};

}

#ifdef __cplusplus
extern "C"
{
#endif


#ifdef __cplusplus
}
#endif

#endif /* RETINA_HPP_ */<commit_msg>Added usage of Image class for image file handling and image processing.<commit_after>/*
 * Retina.h
 *
 *  Created on: Jul 29, 2008
 *
 */

#ifndef RETINA_HPP_
#define RETINA_HPP_

#include "HyPerLayer.hpp"
#include "Image.hpp"
#include "fileread.h"

namespace PV
{

class Retina: public PV::HyPerLayer
{
public:
   Retina(const char * name, HyPerCol * hc);
   Retina(const char * name, HyPerCol * hc, Image * img);
   Retina(const char * name, HyPerCol * hc, const char * filename);

   int init(const char * name, PVLayerType type);
   int setParams(PVParams * params, fileread_params * p);

   virtual int recvSynapticInput(HyPerLayer* lSource, PVLayerCube* cube);
   virtual int updateState(float time, float dt);
   virtual int writeState(const char * path, float time);
   virtual int createImage(pvdata_t * buf);
   virtual int spike(float time, float dt, float prob, float probStim, int * start);

   Image * getImage()  { return img; }

private:

   // For input from a given source input layer, determine which
   // cells in this layer will respond to the input activity.
   // Return the feature vectors for both the input and the sensitive
   // neurons, since most likely we will have to determine those.
   int findPostSynaptic(int dim, int maxSize, int col,
      // input: which layer, which neuron
      HyPerLayer *lSource, float pos[],
      // output: how many of our neurons are connected.
      // an array with their indices.
      // an array with their feature vectors.
      int * nNeurons, int nConnectedNeurons[], float * vPos);

   int calculateWeights(HyPerLayer * lSource, float * pos, float * vPos, float * vfWeights );

   Image * img;
};

} // namespace PV

#endif /* RETINA_HPP_ */
{'fraction_non_alphanumeric': 0.09671587827658934, 'fraction_numerical': 0.0036155468514612837, 'mean_word_length': 3.4563758389261743, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '5286491', 'n_tokens_mistral': 1077, 'n_tokens_neox': 1011, 'n_words': 389}