<commit_before>/*
 * pv_types.h
 *
 *  Created: Sep 10, 2008
 *  Author: dcoates
 */

#ifndef PV_TYPES_H_
#define PV_TYPES_H_

#include <stdlib.h>   /* for size_t */

#define PV_ON  1
#define PV_OFF 0

// WARNING LAYER_CUBE_HEADER_SIZE should be n*128 bits
#define NUM_PADDING 1
#define LAYER_CUBE_HEADER_SIZE (sizeof(PVLayerCube))
#ifdef PV_ARCH_64
#  define EXPECTED_CUBE_HEADER_SIZE 64
#else
#  define EXPECTED_CUBE_HEADER_SIZE 48
#endif

/* The common type for data */
#define pvdata_t float

enum ChannelType {
  CHANNEL_EXC  = 0,
  CHANNEL_INH  = 1,
  CHANNEL_INHB = 2
};

/**
 * PVLayerLoc describes a data items location in the global layer
 */
typedef struct PVLayerLoc_ {
   float nx, ny;
   float nxGlobal, nyGlobal; // total number of neurons in (x,y) across all hypercolumns
   float nxBorder, nyBorder; // size of border region surrounding layer
   float kx0, ky0;  // origin of the layer in index space
} PVLayerLoc;

typedef struct PVRect_ {
	float x;
	float y;
	float width;
	float height;
} PVRect;

typedef struct PVPatch_ {
   pvdata_t * __attribute__ ((aligned)) data;
   float nx, ny, nf;    // number of items in x,y,features
   float sx, sy, sf;    // stride in x,y,features
#ifndef PV_ARCH_64
   float padding;       // structure size should be 8*4 bytes
#endif
} PVPatch __attribute__ ((aligned));

/**
 * PVLayerCube is a 3D cube (features,x,y) of a layer's data,
 *    plus location information
 */
typedef struct PVLayerCube_ {
   size_t     size;      // sizeof entire cube in bytes
   int        numItems;  // number of items in data buffer
   pvdata_t * data;      // pointer to data (may follow header)
   int        padding[NUM_PADDING];   // header size should be n*128 bits
   PVLayerLoc loc;       // location of cube in global layer
} PVLayerCube;

typedef struct PVAxonalArbor_ {
   PVPatch * data;        // data for task to work on (e.g., phi data)
   PVPatch * weights;     // weights to apply to the data
   PVPatch * plasticIncr; // STDP P variable
   size_t    offset;      // offset for post-synaptic activity and pDecr (STDP M variable)
} PVAxonalArbor;

typedef struct PVAxonalArborList_ {
   unsigned int     numArbors;
   PVAxonalArbor ** arbors;
} PVAxonalArborList;<commit_msg>Changes made for PANN (changes in PVLayerLoc, now LayerLoc).<commit_after>/*
 * pv_types.h
 *
 *  Created: Sep 10, 2008
 *  Author: dcoates
 */

#ifndef PV_TYPES_H_
#define PV_TYPES_H_

#include "LayerLoc.h"
#include <stdlib.h>   /* for size_t */

#define PV_ON  1
#define PV_OFF 0

// WARNING LAYER_CUBE_HEADER_SIZE should be n*128 bits
#define NUM_PADDING 1
#define LAYER_CUBE_HEADER_SIZE (sizeof(PVLayerCube))
#ifdef PV_ARCH_64
#  define EXPECTED_CUBE_HEADER_SIZE 64
#else
#  define EXPECTED_CUBE_HEADER_SIZE 48
#endif

/* The common type for data */
#define pvdata_t float

enum ChannelType {
  CHANNEL_EXC  = 0,
  CHANNEL_INH  = 1,
  CHANNEL_INHB = 2
};

typedef struct PVRect_ {
	float x;
	float y;
	float width;
	float height;
} PVRect;

typedef struct PVPatch_ {
   pvdata_t * __attribute__ ((aligned)) data;
   float nx, ny, nf;    // number of items in x,y,features
   float sx, sy, sf;    // stride in x,y,features
#ifndef PV_ARCH_64
   float padding;       // structure size should be 8*4 bytes
#endif
} PVPatch __attribute__ ((aligned));

/**
 * PVLayerCube is a 3D cube (features,x,y) of a layer's data,
 *    plus location information
 */
typedef struct PVLayerCube_ {
   size_t     size;      // sizeof entire cube in bytes
   int        numItems;  // number of items in data buffer
   pvdata_t * data;      // pointer to data (may follow header)
   int        padding[NUM_PADDING];   // header size should be n*128 bits
   LayerLoc loc;       // location of cube in global layer
} PVLayerCube;

typedef struct PVAxonalArbor_ {
   PVPatch * data;        // data for task to work on (e.g., phi data)
   PVPatch * weights;     // weights to apply to the data
   PVPatch * plasticIncr; // STDP P variable
   size_t    offset;      // offset for post-synaptic activity and pDecr (STDP M variable)
} PVAxonalArbor;

typedef struct PVAxonalArborList_ {
   unsigned int     numArbors;
   PVAxonalArbor ** arbors;
} PVAxonalArborList;
{'fraction_non_alphanumeric': 0.08678973867178134, 'fraction_numerical': 0.014385039558858786, 'mean_word_length': 3.134786917740337, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 5, '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': '5593834', 'n_tokens_mistral': 1588, 'n_tokens_neox': 1438, 'n_words': 483}