From cccccbf6cca94a3eaf813b4468453160e91c332b Mon Sep 17 00:00:00 2001
From: Joe Zhao <ztuowen@gmail.com>
Date: Mon, 14 Apr 2014 08:14:45 +0800
Subject: First commit

---
 src/TNetLib/.svn/text-base/BlockArray.h.svn-base | 85 ++++++++++++++++++++++++
 1 file changed, 85 insertions(+)
 create mode 100644 src/TNetLib/.svn/text-base/BlockArray.h.svn-base

(limited to 'src/TNetLib/.svn/text-base/BlockArray.h.svn-base')

diff --git a/src/TNetLib/.svn/text-base/BlockArray.h.svn-base b/src/TNetLib/.svn/text-base/BlockArray.h.svn-base
new file mode 100644
index 0000000..e6a8657
--- /dev/null
+++ b/src/TNetLib/.svn/text-base/BlockArray.h.svn-base
@@ -0,0 +1,85 @@
+#ifndef _BLOCK_ARRAY_H_
+#define _BLOCK_ARRAY_H_
+
+
+#include "Component.h"
+
+#include "Matrix.h"
+#include "Vector.h"
+
+
+namespace TNet {
+
+  class Network;
+
+  class BlockArray : public Component
+  {
+    public:
+
+      BlockArray(size_t nInputs, size_t nOutputs, Component *pPred); 
+      ~BlockArray();  
+      
+      ComponentType GetType() const;
+      const char* GetName() const;
+
+      void PropagateFnc(const Matrix<BaseFloat>& X, Matrix<BaseFloat>& Y);
+      void BackpropagateFnc(const Matrix<BaseFloat>& X, Matrix<BaseFloat>& Y);
+
+      void Update();
+
+      void ReadFromStream(std::istream& rIn);
+      void WriteToStream(std::ostream& rOut);
+ 
+      //:TODO:
+      Component* Clone() const { KALDI_ERR << "Unimplemented"; }
+
+    protected:
+      std::vector<Network*> mBlocks; ///< vector with networks, one network is one block
+      size_t mNBlocks;  
+  };
+
+
+
+
+  ////////////////////////////////////////////////////////////////////////////
+  // INLINE FUNCTIONS 
+  // BlockArray::
+  inline 
+  BlockArray::
+  BlockArray(size_t nInputs, size_t nOutputs, Component *pPred)
+    : Component(nInputs, nOutputs, pPred), 
+      mNBlocks(0) 
+  { }
+
+
+  inline
+  BlockArray::
+  ~BlockArray()
+  { 
+    for(int i=0; i<mBlocks.size(); i++) {
+      delete mBlocks[i];
+    }
+    mBlocks.clear();
+  }
+
+  inline Component::ComponentType
+  BlockArray::
+  GetType() const
+  {
+    return Component::BLOCK_ARRAY;
+  }
+
+  inline const char*
+  BlockArray::
+  GetName() const
+  {
+    return "<blockarray>";
+  }
+
+
+
+} //namespace
+
+
+
+#endif
-- 
cgit v1.2.3-70-g09d2