This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* | |
* File: ClassDefinitions.h | |
* Author: James | |
* | |
* Created on February 4, 2014, 12:50 PM | |
*/ | |
#ifndef CLASSDEF_H | |
#define CLASSDEF_H | |
#include "structs.h" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
for(int i=0;i<num_hidden;i++) | |
{ | |
for(int j=0;j<innum;j++) | |
{ | |
hidden_val[i]+= inputs[j][x].data*current[person_num][wt_ctr++].weight; | |
} | |
hidden_val[i]+= 1*current[person_num][wt_ctr++].weight; | |
hidden_val[i] = Activation_sig(hidden_val[i]); | |
assert(wt_ctr!=wtqty); | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
current.resize(boost::extents[ini1.popsize][ini1.wtqt]); | |
if(iter==0) // if this is the first iteration, populate with randoms | |
{ | |
for(int j=0;j<ini1.popsize;j++) // create individuals | |
{ | |
for(int k=0;k<ini1.wtqt;k++) // randomize the "genes" (weights in this case) for the entire chroma | |
{ | |
current[j][k].weight=RNG_normal( prob.RNG_SD ); | |
} | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
for(int itr=0; itr< params.array[26]; itr++){//every order is sequential and run after the previous order to massively simplify the workload in this kernel. | |
double tmp; | |
//set stuff to zero | |
if(commandQueue[itr].first.def == typeHidden && commandQueue[itr].second.def == typeZero){ | |
neuroZero(Vec.array[hiddenOffset+commandQueue[itr].first.id*ind]); | |
} | |
else if(commandQueue[itr].first.def == typeMemGateIn && commandQueue[itr].second.def == typeZero){ | |
neuroZero(Vec.array[memGateInOffset+commandQueue[itr].first.id*ind]); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
def doesAccountIDExist(id: Int): Boolean = { | |
///this is the line that fails | |
val tmp = g._graph.V.hasLabel("account").has(accountIDKey -> id).toList() | |
g._graph.tx().commit() | |
if (tmp.nonEmpty) Console.println("Success, index works.") | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
case class EditProfileForm(accountID: Int, | |
localProfileID: Int, | |
profileName: Option[String], | |
profileGender: Option[Int], | |
profileBirthday: Option[String]) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* Created by james on 22/01/16. | |
*/ | |
sealed class GenericRecommender extends Constructors{ | |
def apply(constructor: GenericConstructor){ | |
constructor match{ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
trait ConnectionInMemory { | |
var graph: TitanGraph = null | |
def connect() = { | |
import org.apache.commons.configuration.BaseConfiguration | |
val conf = new BaseConfiguration() | |
conf.setProperty("storage.backend","inmemory") | |
import com.thinkaurelius.titan.core.TitanFactory | |
graph = TitanFactory.open(conf) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
object TitanCon extends InMemory with InCassandra{ | |
lazy var Graph: TitanGraph | |
def connect(backendType: String): Unit = { | |
Graph = backendType match { | |
case "inMemory" => memoryConnect() | |
case "inCassandra" => cassandraConnect() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
"properly accept a new account request" in { | |
Post("account/new", NewAccountForm(100, "zeryx")) ~> check{ | |
val json = parse(responseAs[String]) | |
val check: String = (for{ | |
JString(returnType) <- (json \ "RETURN CODE").toOption | |
} yield returnType).getOrElse("None") | |
("RETURN CODE" -> check) === Frontend.success |
OlderNewer