Skip to content

Instantly share code, notes, and snippets.

View gamemachine's full-sized avatar

Chris Ochs gamemachine

View GitHub Profile
int rngSeed = 123; // random number seed for reproducibility
MultiLayerConfiguration conf = new NeuralNetConfiguration.Builder()
.seed(rngSeed) //include a random seed for reproducibility
// use stochastic gradient descent as an optimization algorithm
.optimizationAlgo(OptimizationAlgorithm.STOCHASTIC_GRADIENT_DESCENT)
.iterations(1)
.learningRate(0.006) //specify the learning rate
.updater(org.deeplearning4j.nn.conf.Updater.NESTEROVS).momentum(0.9) //specify the rate of change of the learning rate.
.regularization(true).l2(1e-4)
using System.Collections.Generic;
using System.Linq;
namespace GameCommon
{
public class SpatialGrid
{
public static Dictionary<string, SpatialGrid> Grids = new Dictionary<string, SpatialGrid>();
private Dictionary<int, Dictionary<string, GridValue>> Cells = new Dictionary<int, Dictionary<string, GridValue>>();
private Dictionary<string, GridValue> ObjectIndex = new Dictionary<string, GridValue>();
public class Tree1 : IBtree
{
[BtreeNode("test1")]
private BtreeNodeStatus Node1()
{
return BtreeNodeStatus.Success;
}
[BtreeNode("test1")]
private BtreeNodeStatus Node2()
using System.Collections;
using System.Collections.Generic;
using UltimateWater;
using UnityEngine;
namespace AiGame
{
public class KinematicBuoyancy : MonoBehaviour
{
public float DefaultHeight;
using System.Collections.Generic;
using UnityEngine;
namespace AiGame
{
public class GameObjectPool : MonoBehaviour
{
public static Vector3 DefaultPosition = new Vector3(0f, 10000f, 0f);
public static GameObjectPool Instance;
using Unity.Burst;
using Unity.Collections;
using Unity.Entities;
using Unity.Jobs;
using Unity.Mathematics;
using UnityEngine;
namespace AiGame.Ecs.Systems
{
public class LosDirectSystem : JobComponentSystem
void ClipBounds(float4 bounds, float2 pos) {
float2 min = bounds.xy;
float2 max = bounds.zw;
float a = step(min.x, pos.x);
float b = step(pos.x, max.x);
float c = step(min.y, pos.y);
float d = step(pos.y, max.y);
clip(3.0f - a - b - c - d);
using System.Diagnostics;
using UnityEngine;
namespace Crest
{
[System.Serializable]
public class CrestTimeProvider
{
private const float MaxDifferenceBeforeAdjust = 0.5f;
using System;
using UnityEngine;
using System.Collections;
using System.Collections.Generic;
namespace PvpGame
{
public class GridValue
{
public enum EntityType
using System;
using System.Collections.Generic;
using System.Linq;
using System.Reflection;
namespace AwesomeTechnologies.Extensions
{
public static class VsProExtensions
{
public static IEnumerable<Type> GetLoadableTypes(this Assembly assembly)