<commit_before>/*
 * RandomConn.hpp
 *
 *  Created on: Apr 27, 2009
 *      Author: rasmussn
 */

#ifndef RANDOMCONN_HPP_
#define RANDOMCONN_HPP_

#include "HyPerConn.hpp"

namespace PV {

class RandomConn: public PV::HyPerConn {
public:
   RandomConn(const char * name,
              HyPerCol * hc, HyPerLayer * pre, HyPerLayer * post, int channel);

   virtual int initializeWeights(const char * filename);
};

}

#endif /* RANDOMCONN_HPP_ */<commit_msg>Shreyas's chnages to this class: includes a constructor with a distribution type as argument. <commit_after>/*
 * RandomConn.hpp
 *
 *  Created on: Apr 27, 2009
 *      Author: rasmussn
 */

#ifndef RANDOMCONN_HPP_
#define RANDOMCONN_HPP_

#include "HyPerConn.hpp"

namespace PV {

enum RandDistType {
   UNDEFINED = 0,
   UNIFORM = 1,
   GAUSSIAN = 2
};

class RandomConn: public PV::HyPerConn {
public:
   RandomConn(const char * name, HyPerCol * hc, HyPerLayer * pre,
              HyPerLayer * post, int channel);

   RandomConn(const char * name, HyPerCol * hc, HyPerLayer * pre,
              HyPerLayer * post, int channel, RandDistType distrib);

   virtual int initializeWeights(const char * filename);
   int initializeUniformWeights(int seed);
   int uniformWeights(PVPatch * wp, float wMin, float wMax, int seed);
   int initializeGaussianWeights(int seed);
   int gaussianWeights(PVPatch *wp, float mean, float stdev, int seed);
   int gaussianWeightsMA(PVPatch *wp, float mean, float stdev, long *);
   float randgauss(float mean, float stdev);
   float randgaussMA(float mean, float stdev, long *);
private:
   float          wMin;
   RandDistType   randDistType; // the type of distribution
   float          wGaussMean;   // mean of the Gaussian distribution
   float          wGaussStdev;  // std deviation of the Gaussian distribution
   long           idum;

   void InitRandomConn(const char *name, HyPerCol *hc,
                       HyPerLayer *pre, HyPerLayer *post, int channel);

   float ranf();
   float ran1(long *);
};

}

#endif /* RANDOMCONN_HPP_ */
{'fraction_non_alphanumeric': 0.09371933267909716, 'fraction_numerical': 0.007850834151128557, 'mean_word_length': 3.2302904564315353, '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': '5262137', 'n_tokens_mistral': 692, 'n_tokens_neox': 648, 'n_words': 200}