<commit_before>/*
 * geisler.cpp
 *
 */

#include <stdlib.h>
#include <time.h>

#include "../PetaVision/src/columns/HyPerCol.hpp"
#include "../PetaVision/src/connections/HyPerConn.hpp"
#include "../PetaVision/src/connections/KernelConn.hpp"
#include "../PetaVision/src/connections/CocircConn.hpp"
#include "../PetaVision/src/connections/GeislerConn.hpp"
#include "../PetaVision/src/connections/AvgConn.hpp"
#include "../PetaVision/src/layers/Movie.hpp"
#include "../PetaVision/src/layers/Image.hpp"
#include "../PetaVision/src/layers/Retina.hpp"
#include "../PetaVision/src/layers/V1.hpp"
#include "../PetaVision/src/layers/GeislerLayer.hpp"
#include "../PetaVision/src/io/ConnectionProbe.hpp"
#include "../PetaVision/src/io/GLDisplay.hpp"
#include "../PetaVision/src/io/PostConnProbe.hpp"
#include "../PetaVision/src/io/LinearActivityProbe.hpp"
#include "../PetaVision/src/io/PointProbe.hpp"
#include "../PetaVision/src/io/StatsProbe.hpp"

//#include "../PetaVisionsrc/io/imageio.hpp"


using namespace PV;

int main(int argc, char* argv[]) {

	//int iseed = time(NULL);
	//srand ( iseed );

	// create the managing hypercolumn
	//
	HyPerCol * hc = new HyPerCol("column", argc, argv);

	// create the visualization display
	//
	//GLDisplay * display = new GLDisplay(&argc, argv, hc, 2, 2);

#undef SPIKING
#ifdef SPIKING  // load geisler kernels from pvp file

	// create the image
	//
	const char * amoeba_filename = "../PetaVision/mlab/amoebaGen/128_png/4/t/tar_0000_a.png";
	Image * image = new Image("Image", hc, amoeba_filename);
	//display->setDelay(0);
	//display->setImage(image);

	// create the layers
	//
	HyPerLayer * retina = new Retina("Retina", hc, image);
	HyPerLayer * lgn = new V1("LGN", hc);
	HyPerLayer * lgninhff = new V1("LGNInhFF", hc);
	HyPerLayer * lgninh = new V1("LGNInh", hc);
	HyPerLayer * l1 = new V1("L1", hc);
	HyPerLayer * l1inhff = new V1("L1InhFF", hc);
	HyPerLayer * l1inh = new V1("L1Inh", hc);

	// create averaging layers
//	HyPerLayer * l1avg = new V1("L1Avg", hc);

	//display->addLayer(l1);
	//display->addLayer(l1inh);
	//display->addLayer(l1avg);


	// create the connections
	//
	// retinal connections
	HyPerConn * r_lgn =
		new KernelConn("Retina to LGN", hc, retina, lgn,
			CHANNEL_EXC);
	HyPerConn * r_lgninhff =
		new KernelConn("Retina to LGNInhFF", hc, retina, lgninhff,
			CHANNEL_EXC);


	// LGN connections
	HyPerConn * lgn_lgninhff =
		new KernelConn("LGN to LGNInhFF", 	hc, lgn, lgninhff,
			CHANNEL_EXC);
	HyPerConn * lgn_lgninh =
		new KernelConn("LGN to LGNInh", 	hc, lgn, lgninh,
			CHANNEL_EXC);
	HyPerConn * lgn_l1 =
		new KernelConn("LGN to L1",     	hc, lgn,  l1,
			CHANNEL_EXC);
	HyPerConn * lgn_l1inhff =
		new KernelConn("LGN to L1InhFF",    hc, lgn,  l1inhff,
			CHANNEL_EXC);


	// LGNInhFF connections
	HyPerConn * lgninhff_lgn =
		new KernelConn("LGNInhFF to LGN", 			hc, lgninhff, lgn,
			CHANNEL_INH);
	HyPerConn * lgninhff_lgn_inhB =
		new KernelConn("LGNInhFF to LGN InhB", 		hc, lgninhff, lgn,
			CHANNEL_INHB);
	HyPerConn * lgninhff_lgninhff_exc =
		new KernelConn("LGNInhFF to LGNInhFF Exc", 	hc, lgninhff, lgninhff,
			CHANNEL_EXC);
//	HyPerConn * lgninhff_lgninhff =
//		new KernelConn("LGNInhFF to LGNInhFF", 		hc, lgninhff, lgninhff,
//			CHANNEL_INH);
//	HyPerConn * lgninhff_lgninhff_inhB =
//		new KernelConn("LGNInhFF to LGNInhFF InhB", hc, lgninhff, lgninhff,
//			CHANNEL_INHB);
	HyPerConn * lgninhff_lgninh =
		new KernelConn("LGNInhFF to LGNInh", 		hc, lgninhff, lgninh,
			CHANNEL_INH);
	HyPerConn * lgninhff_lgninh_inhB =
		new KernelConn("LGNInhFF to LGNInh InhB", 	hc, lgninhff, lgninh,
			CHANNEL_INHB);


	// LGNInh connections
	HyPerConn * lgninh_lgn =
		new KernelConn("LGNInh to LGN", 		hc, lgninh, lgn,
			CHANNEL_INH);
	HyPerConn * lgninh_lgninh_exc =
		new KernelConn("LGNInh to LGNInh Exc", 	hc, lgninh, lgninh,
			CHANNEL_EXC);
	HyPerConn * lgninh_lgninh =
		new KernelConn("LGNInh to LGNInh", 		hc, lgninh, lgninh,
			CHANNEL_INH);


	// L1 connections
	const char * geisler_filename = "./input/test_amoeba_target_4fc/geisler_clean.pvp";
	HyPerConn * l1_lgn =
		new KernelConn("L1 to LGN",  	hc, l1,     lgn,
			CHANNEL_EXC);
	HyPerConn * l1_lgninh =
		new KernelConn("L1 to LGNInh",  hc, l1,     lgninh,
			CHANNEL_EXC);
	HyPerConn * l1_l1 =
		new KernelConn("L1 to L1",      hc, l1,     l1,
			CHANNEL_EXC, geisler_filename);
	HyPerConn * l1_l1inhff =
		new CocircConn("L1 to L1InhFF", hc, l1,   	l1inhff,
			CHANNEL_EXC);
	HyPerConn * l1_l1inh =
		new KernelConn("L1 to L1Inh",   hc, l1,     l1inh,
			CHANNEL_EXC, geisler_filename);


	// L1 Inh FF connections
	HyPerConn * l1inhff_l1 =
		new CocircConn("L1InhFF to L1",   			hc, l1inhff,  l1,
			CHANNEL_INH);
	HyPerConn * l1inhff_l1_inhB =
		new CocircConn("L1InhFF to L1 InhB",   		hc, l1inhff,  l1,
			CHANNEL_INHB);
	HyPerConn * l1inhff_l1inhff_exc =
		new CocircConn("L1InhFF to L1InhFF Exc",   	hc, l1inhff,  l1inhff,
			CHANNEL_EXC);
	HyPerConn * l1inhff_l1inhff =
		new CocircConn("L1InhFF to L1InhFF",   		hc, l1inhff,  l1inhff,
			CHANNEL_INH);
	HyPerConn * l1inhff_l1inhff_inhB =
		new CocircConn("L1InhFF to L1InhFF InhB",   hc, l1inhff,  l1inhff,
			CHANNEL_INHB);
	HyPerConn * l1inhff_l1inh =
		new CocircConn("L1InhFF to L1Inh",  		hc, l1inhff,  l1inh,
			CHANNEL_INH);
	HyPerConn * l1inhff_l1inh_inhB =
		new CocircConn("L1InhFF to L1Inh InhB",   	hc, l1inhff,  l1inh,
			CHANNEL_INHB);


	// L1 Inh connections
	HyPerConn * l1inh_l1 =
		new CocircConn("L1Inh to L1",   		hc, l1inh,  l1,
			CHANNEL_INH);
//	HyPerConn * l1inh_l1inhff =
//		new CocircConn("L1Inh to L1InhFF",  	hc, l1inh,  l1inhff,
//			CHANNEL_INH);
	HyPerConn * l1inh_l1inh_exc =
		new CocircConn("L1Inh to L1Inh Exc",   	hc, l1inh,  l1inh,
			CHANNEL_EXC);
	HyPerConn * l1inh_l1inh_inh =
		new CocircConn("L1Inh to L1Inh Inh",   	hc, l1inh,  l1inh,
			CHANNEL_INH);

	// create averaging connections
	//
//	HyPerConn * l1_l1avg   = new AvgConn("L1 to L1Avg", hc, l1, l1avg, CHANNEL_EXC, NULL);


	// add probes

	HyPerLayer * displayLayer = retina;<commit_msg>updated spiking main<commit_after>/*
 * geisler.cpp
 *
 */

#include <stdlib.h>
#include <time.h>

#include "../PetaVision/src/columns/HyPerCol.hpp"
#include "../PetaVision/src/connections/HyPerConn.hpp"
#include "../PetaVision/src/connections/KernelConn.hpp"
#include "../PetaVision/src/connections/CocircConn.hpp"
#include "../PetaVision/src/connections/GeislerConn.hpp"
#include "../PetaVision/src/connections/AvgConn.hpp"
#include "../PetaVision/src/layers/Movie.hpp"
#include "../PetaVision/src/layers/Image.hpp"
#include "../PetaVision/src/layers/Retina.hpp"
#include "../PetaVision/src/layers/V1.hpp"
#include "../PetaVision/src/layers/GeislerLayer.hpp"
#include "../PetaVision/src/io/ConnectionProbe.hpp"
#include "../PetaVision/src/io/GLDisplay.hpp"
#include "../PetaVision/src/io/PostConnProbe.hpp"
#include "../PetaVision/src/io/LinearActivityProbe.hpp"
#include "../PetaVision/src/io/PointProbe.hpp"
#include "../PetaVision/src/io/StatsProbe.hpp"

//#include "../PetaVisionsrc/io/imageio.hpp"


using namespace PV;

int main(int argc, char* argv[]) {

	//int iseed = time(NULL);
	//srand ( iseed );

	// create the managing hypercolumn
	//
	HyPerCol * hc = new HyPerCol("column", argc, argv);

	// create the visualization display
	//
	//GLDisplay * display = new GLDisplay(&argc, argv, hc, 2, 2);

#define SPIKING
#ifdef SPIKING  // load geisler kernels from pvp file

	// create the image
	//
	const char * amoeba_filename = "../PetaVision/mlab/amoebaGen/128_png/2/t/tar_0001_a.png";
	//display->setDelay(0);
	//display->setImage(image);

	// create the layers
	//
	HyPerLayer * image = new Image("Image", hc, amoeba_filename);
	HyPerLayer * retina = new Retina("Retina", hc);
	HyPerLayer * lgn = new V1("LGN", hc);
	HyPerLayer * lgninhff = new V1("LGNInhFF", hc);
	HyPerLayer * lgninh = new V1("LGNInh", hc);
	HyPerLayer * l1 = new V1("L1", hc);
	HyPerLayer * l1inhff = new V1("L1InhFF", hc);
	HyPerLayer * l1inh = new V1("L1Inh", hc);

	// create averaging layers
//	HyPerLayer * l1avg = new V1("L1Avg", hc);

	//display->addLayer(l1);
	//display->addLayer(l1inh);
	//display->addLayer(l1avg);


	// create the connections
	//

	HyPerConn * image_retina  =
		new KernelConn("Image to Retina",   hc, image, retina, CHANNEL_EXC);

	// retinal connections
	HyPerConn * r_lgn =
		new KernelConn("Retina to LGN", hc, retina, lgn,
			CHANNEL_EXC);
	HyPerConn * r_lgninhff =
		new KernelConn("Retina to LGNInhFF", hc, retina, lgninhff,
			CHANNEL_EXC);


	// LGN connections
//	HyPerConn * lgn_lgninhff =
//		new KernelConn("LGN to LGNInhFF", 	hc, lgn, lgninhff,
//			CHANNEL_EXC);
	HyPerConn * lgn_lgninh =
		new KernelConn("LGN to LGNInh", 	hc, lgn, lgninh,
			CHANNEL_EXC);
	HyPerConn * lgn_l1 =
		new KernelConn("LGN to L1",     	hc, lgn,  l1,
			CHANNEL_EXC);
	HyPerConn * lgn_l1inhff =
		new KernelConn("LGN to L1InhFF",    hc, lgn,  l1inhff,
			CHANNEL_EXC);


	// LGNInhFF connections
	HyPerConn * lgninhff_lgn =
		new KernelConn("LGNInhFF to LGN", 			hc, lgninhff, lgn,
			CHANNEL_INH);
//	HyPerConn * lgninhff_lgn_inhB =
//		new KernelConn("LGNInhFF to LGN InhB", 		hc, lgninhff, lgn,
//			CHANNEL_INHB);
//	HyPerConn * lgninhff_lgninhff_exc =
//		new KernelConn("LGNInhFF to LGNInhFF Exc", 	hc, lgninhff, lgninhff,
//			CHANNEL_EXC);
//	HyPerConn * lgninhff_lgninhff =
//		new KernelConn("LGNInhFF to LGNInhFF", 		hc, lgninhff, lgninhff,
//			CHANNEL_INH);
//	HyPerConn * lgninhff_lgninhff_inhB =
//		new KernelConn("LGNInhFF to LGNInhFF InhB", hc, lgninhff, lgninhff,
//			CHANNEL_INHB);
//	HyPerConn * lgninhff_lgninh =
//		new KernelConn("LGNInhFF to LGNInh", 		hc, lgninhff, lgninh,
//			CHANNEL_INH);
//	HyPerConn * lgninhff_lgninh_inhB =
//		new KernelConn("LGNInhFF to LGNInh InhB", 	hc, lgninhff, lgninh,
//			CHANNEL_INHB);


	// LGNInh connections
	HyPerConn * lgninh_lgn =
		new KernelConn("LGNInh to LGN", 		hc, lgninh, lgn,
			CHANNEL_INH);
	HyPerConn * lgninh_lgninh_exc =
		new KernelConn("LGNInh to LGNInh Exc", 	hc, lgninh, lgninh,
			CHANNEL_EXC);
	HyPerConn * lgninh_lgninh =
		new KernelConn("LGNInh to LGNInh", 		hc, lgninh, lgninh,
			CHANNEL_INH);


	// L1 connections
	const char * geisler_filename = "./input/test_amoeba_target_4fc/geisler_clean.pvp";
	HyPerConn * l1_lgn =
		new KernelConn("L1 to LGN",  	hc, l1,     lgn,
			CHANNEL_EXC);
	HyPerConn * l1_lgninh =
		new KernelConn("L1 to LGNInh",  hc, l1,     lgninh,
			CHANNEL_EXC);
	HyPerConn * l1_l1 =
		new KernelConn("L1 to L1",      hc, l1,     l1,
			CHANNEL_EXC, geisler_filename);
//	HyPerConn * l1_l1inhff =
//		new CocircConn("L1 to L1InhFF", hc, l1,   	l1inhff,
//			CHANNEL_EXC);
	HyPerConn * l1_l1inh =
		new KernelConn("L1 to L1Inh",   hc, l1,     l1inh,
			CHANNEL_EXC, geisler_filename);


	// L1 Inh FF connections
	HyPerConn * l1inhff_l1 =
		new CocircConn("L1InhFF to L1",   			hc, l1inhff,  l1,
			CHANNEL_INH);
//	HyPerConn * l1inhff_l1_inhB =
//		new CocircConn("L1InhFF to L1 InhB",   		hc, l1inhff,  l1,
//			CHANNEL_INHB);
//	HyPerConn * l1inhff_l1inhff_exc =
//		new CocircConn("L1InhFF to L1InhFF Exc",   	hc, l1inhff,  l1inhff,
//			CHANNEL_EXC);
//	HyPerConn * l1inhff_l1inhff =
//		new CocircConn("L1InhFF to L1InhFF",   		hc, l1inhff,  l1inhff,
//			CHANNEL_INH);
//	HyPerConn * l1inhff_l1inhff_inhB =
//		new CocircConn("L1InhFF to L1InhFF InhB",   hc, l1inhff,  l1inhff,
//			CHANNEL_INHB);
//	HyPerConn * l1inhff_l1inh =
//		new CocircConn("L1InhFF to L1Inh",  		hc, l1inhff,  l1inh,
//			CHANNEL_INH);
//	HyPerConn * l1inhff_l1inh_inhB =
//		new CocircConn("L1InhFF to L1Inh InhB",   	hc, l1inhff,  l1inh,
//			CHANNEL_INHB);


	// L1 Inh connections
	HyPerConn * l1inh_l1 =
		new CocircConn("L1Inh to L1",   		hc, l1inh,  l1,
			CHANNEL_INH);
//	HyPerConn * l1inh_l1inhff =
//		new CocircConn("L1Inh to L1InhFF",  	hc, l1inh,  l1inhff,
//			CHANNEL_INH);
	HyPerConn * l1inh_l1inh_exc =
		new CocircConn("L1Inh to L1Inh Exc",   	hc, l1inh,  l1inh,
			CHANNEL_EXC);
	HyPerConn * l1inh_l1inh_inh =
		new CocircConn("L1Inh to L1Inh Inh",   	hc, l1inh,  l1inh,
			CHANNEL_INH);

	// create averaging connections
	//
//	HyPerConn * l1_l1avg   = new AvgConn("L1 to L1Avg", hc, l1, l1avg, CHANNEL_EXC, NULL);


	// add probes

	HyPerLayer * displayLayer = retina;
{'fraction_non_alphanumeric': 0.1395310706673225, 'fraction_numerical': 0.022298737497950482, 'mean_word_length': 3.66322629969419, 'pattern_counts': {'":': 0, '<': 7, '<?xml version=': 0, '>': 17, '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': '5856536', 'n_tokens_mistral': 5993, 'n_tokens_neox': 5625, 'n_words': 1066}