示例#1
0
 public FNodeSet(Schema Columns, bool AlloowDotNames)
     : this()
 {
     
     this.AllowNameDotName = AlloowDotNames;
     for (int i = 0; i < Columns.Count; i++)
     {
         this.Add(Columns.ColumnName(i), new FNodeFieldRef(null, i, Columns.ColumnAffinity(i), Columns.ColumnSize(i), null));
     }
 }
示例#2
0
        public FNodeSet(Schema Columns, Key Fields)
            : this()
        {

            this.AllowNameDotName = false;
            for (int i = 0; i < Fields.Count; i++)
            {
                this.Add(Columns.ColumnName(Fields[i]), new FNodeFieldRef(null, Fields[i], Columns.ColumnAffinity(Fields[i]), Columns.ColumnSize(Fields[i]), null));
            }
        }
示例#3
0
            public NN_Layer(bool Bias, Key Fields, Schema Columns)
                : this()
            {

                // Check if rendered //
                if (this._IsRendered)
                    throw new Exception("Layer already rendered");

                // Add the bias node //
                if (Bias)
                    this._Nodes.Add(new NeuralNodeStatic("DATA_BIAS", 1));

                // Add the references //
                for (int i = 0; i < Fields.Count; i++)
                    this._Nodes.Add(new NeuralNodeReference(Columns.ColumnName(Fields[i]), Fields[i]));

                // Tag as rendered //
                this._IsRendered = true;

            }
示例#4
0
            public NN_Layer(NodeReduction Connector, ScalarFunction Activator, Key Fields, Schema Columns)
                : this()
            {

                // Check if rendered //
                if (this._IsRendered)
                    throw new Exception("Layer already rendered");

                // Add the references //
                for (int i = 0; i < Fields.Count; i++)
                    this._Nodes.Add(new NeuralNodePrediction(Columns.ColumnName(Fields[i]), Activator, Connector, Fields[i]));

                // Tag as rendered //
                this._IsRendered = true;

            }
示例#5
0
文件: Schema.cs 项目: pwdlugosz/Horse
        /// <summary>
        /// Creates a schema from another schema
        /// </summary>
        /// <param name="S">The starting point schema</param>
        /// <param name="K">A key representing the columns to keep</param>
        /// <returns>A schema</returns>
        public static Schema Split(Schema S, Key K)
        {

            Schema s = new Schema();
            for (int i = 0; i < K.Count; i++)
            {
                s.Add(S.ColumnName(K[i]), S.ColumnAffinity(K[i]), S.ColumnNull(K[i]), S.ColumnSize(K[i]));
            }
            return s;

        }
示例#6
0
文件: Schema.cs 项目: pwdlugosz/Horse
        // Statics //
        /// <summary>
        /// Combines two schemas; throws an exception if two columns have the same name.
        /// </summary>
        /// <param name="S1">The left schema</param>
        /// <param name="S2">The right schema</param>
        /// <returns>A combined schema</returns>
        public static Schema Join(Schema S1, Schema S2)
        {

            Schema s = new Schema();
            for (int i = 0; i < S1.Count; i++)
            {
                s.Add(S1.ColumnName(i), S1.ColumnAffinity(i), S1.ColumnNull(i), S1.ColumnSize(i));
            }
            for (int i = 0; i < S2.Count; i++)
            {
                s.Add(S2.ColumnName(i), S2.ColumnAffinity(i), S2.ColumnNull(i), S2.ColumnSize(i));
            }
            return s;

        }
示例#7
0
        public void Repoint(Schema OriginalSchema, Schema NewSchema)
        {

            if (this._idx >= OriginalSchema.Count)
                throw new Exception("Original schema is invalid");
            if (OriginalSchema.ColumnAffinity(this._idx) != this._affinity)
                throw new Exception("Original schema is invalid");

            string name = OriginalSchema.ColumnName(this._idx);
            int new_index = NewSchema.ColumnIndex(name);

            if (new_index == -1)
                throw new Exception("New schema is invalid");
            if (NewSchema.ColumnAffinity(new_index) != this._affinity)
                throw new Exception("New schema is invalid");

            this._idx = new_index;

        }
示例#8
0
 public override string Unparse(Schema S)
 {
     if (S == null)
         return string.Format("@R[{0}]", this._idx) + (this._memory == null ? "NULL_MEM" : "");
     return S.ColumnName(this._idx) + (this._memory == null ? "NULL_MEM" : "");
 }
示例#9
0
 public static Schema Build(Schema S1, string Alias1, Schema S2, string Alias2, string Delim)
 {
     Schema s = new Schema();
     for (int i = 0; i < S1.Count; i++)
         s.Add(Alias1 + Delim + S1.ColumnName(i), S1.ColumnAffinity(i), S1.ColumnNull(i), S1.ColumnSize(i));
     for (int i = 0; i < S2.Count; i++)
         s.Add(Alias2 + Delim + S2.ColumnName(i), S2.ColumnAffinity(i), S2.ColumnNull(i), S2.ColumnSize(i));
     return s;
 }