public override void SetInspector(GameObject inspector, GameObject singleInput, GameObject singleSelect) { Inspector inspector1 = inspector.GetComponent<Inspector>(); inspector.transform.Find("Quad/NodeName").GetComponent<TextMesh>().text = "Max Pooling Layer"; var poolShapeObj = Instantiate(singleInput); inspector1.Add(poolShapeObj.transform); poolShapeObj.GetComponent<ParamTypein>().SetValue("Pool Shape", poolShape.ToString()); var strideObj = Instantiate(singleInput); inspector1.Add(strideObj.transform); strideObj.GetComponent<ParamTypein>().SetValue("Stride", stride.ToString()); var padObj = Instantiate(singleSelect); inspector1.Add(padObj.transform); padObj.GetComponent<ParamSelect>().SetType(typeof(MyBoolean), "Pad", (int)pad); var lowerPadObj = Instantiate(singleInput); inspector1.Add(lowerPadObj.transform); lowerPadObj.GetComponent<ParamTypein>().SetValue("Lower Pad", lowerPad.ToString()); var upperPadObj = Instantiate(singleInput); inspector1.Add(upperPadObj.transform); upperPadObj.GetComponent<ParamTypein>().SetValue("Upper Pad", upperPadObj.ToString()); inspector1.OnSave = () => { poolShape = Convert.ToUInt32(poolShapeObj.GetComponent<ParamTypein>().GetValue()); stride = Convert.ToUInt32(strideObj.GetComponent<ParamTypein>().GetValue()); pad = (MyBoolean)padObj.GetComponent<ParamSelect>().GetValue(); lowerPad = Convert.ToUInt32(lowerPadObj.GetComponent<ParamTypein>().GetValue()); upperPad = Convert.ToUInt32(upperPadObj.GetComponent<ParamTypein>().GetValue()); }; }
public override void SetInspector(GameObject inspector, GameObject singleInput, GameObject singleSelect) { Inspector inspector1 = inspector.GetComponent <Inspector>(); inspector.transform.Find("Quad/NodeName").GetComponent <TextMesh>().text = "Linear Layer"; var initObj = Instantiate(singleSelect); inspector1.Add(initObj.transform); initObj.GetComponent <ParamSelect>().SetType(typeof(RandomInitialization), "init", (int)init); var outDimObj = Instantiate(singleInput); inspector1.Add(outDimObj.transform); outDimObj.GetComponent <ParamTypein>().SetValue("outDim", outDim.ToString()); var initValueScaleObj = Instantiate(singleInput); inspector1.Add(initValueScaleObj.transform); initValueScaleObj.GetComponent <ParamTypein>().SetValue("initValueScale", initValueScale.ToString()); var biasObj = Instantiate(singleSelect); inspector1.Add(biasObj.transform); biasObj.GetComponent <ParamSelect>().SetType(typeof(MyBoolean), "Bias", (int)bias); inspector1.OnSave = () => { Debug.Log(GetHashCode()); init = (RandomInitialization)initObj.GetComponent <ParamSelect>().GetValue(); outDim = System.Convert.ToUInt32(outDimObj.GetComponent <ParamTypein>().GetValue()); initValueScale = System.Convert.ToSingle(initValueScaleObj.GetComponent <ParamTypein>().GetValue()); bias = (MyBoolean)biasObj.GetComponent <ParamSelect>().GetValue(); }; }
public override void SetInspector(GameObject inspector, GameObject signleLineInput, GameObject signleLineSelect) { Inspector inspector1 = inspector.GetComponent <Inspector>(); inspector.transform.Find("Quad/NodeName").GetComponent <TextMesh>().text = "Convolutional Node"; var activationObj = Instantiate(signleLineSelect); inspector1.Add(activationObj.transform); activationObj.GetComponent <ParamSelect>().SetType(typeof(ActivationFunction), "Activation Function", (int)activation); var initObj = Instantiate(signleLineSelect); inspector1.Add(initObj.transform); initObj.GetComponent <ParamSelect>().SetType(typeof(RandomInitialization), "Init", (int)init); inspector1.OnSave = () => { Debug.Log(GetHashCode()); activation = (ActivationFunction)activationObj.GetComponent <ParamSelect>().GetValue(); init = (RandomInitialization)initObj.GetComponent <ParamSelect>().GetValue(); }; }
public override void SetInspector(GameObject inspector, GameObject signleLineInput, GameObject signleLineSelect) { Inspector inspector1 = inspector.GetComponent <Inspector>(); inspector.transform.Find("Quad/NodeName").GetComponent <TextMesh>().text = "Criterion Node"; var lossFunctionObj = Instantiate(signleLineSelect); inspector1.Add(lossFunctionObj.transform); lossFunctionObj.GetComponent <ParamSelect>().SetType(typeof(LossFunction), "Loss Function", (int)lossFunction); inspector1.OnSave = () => { lossFunction = (LossFunction)lossFunctionObj.GetComponent <ParamSelect>().GetValue(); }; }
public override void SetInspector(GameObject inspector, GameObject signleLineInput, GameObject signleLineSelect) { Inspector inspector1 = inspector.GetComponent <Inspector>(); inspector.transform.Find("Quad/NodeName").GetComponent <TextMesh>().text = "Evaluation Node"; var errObj = Instantiate(signleLineSelect); inspector1.Add(errObj.transform); errObj.GetComponent <ParamSelect>().SetType(typeof(Algorithm), "err", (int)err); inspector1.OnSave = () => { Debug.Log(GetHashCode()); err = (Algorithm)errObj.GetComponent <ParamSelect>().GetValue(); }; }