1

I used the following program:

def show(self):
        output = str(self.inodes) + " " + str(self.hnodes) + " " + str(self.onodes) + " " + str(self.lr) + " " + str(self.wih) + " " + str(self.who)
        
        return output

to get the stats of a neural network as a string, which i then want to save via:

networkSave = n.show()
datei = open("FILEPATH/FILENAME.txt", mode='w')
datei.write(networkSave)
datei.close()

in a txtfile. The code works good so far. The problem is though that in my design the array "self.wih" has over 70.000 entries and I get those dots in the said txt file where the array is only abbreviated depicted:

[[ 0.02742568  0.07564016  0.01795626 ...  0.01656147 -0.07529069
   0.00203228]
 [ 0.01877599 -0.07540431 -0.02055005 ...  0.03289611 -0.01307233
  -0.01261936]
 [-0.0029786  -0.05353505 -0.04538922 ... -0.004011   -0.03398194
  -0.0058061 ]

Anyone has a clue how to force python to give the full array as string?

AnaCoder
  • 13
  • 2
  • I think if You typed it out by hand it should be fine – Matiiss Mar 31 '21 at 21:06
  • Python is not the one adding ellipses. Presumably this logic lies inside of the implementation of `__str__` for `inodes`, `hnodes`, etc. What are the types of those variables? – 0x5453 Mar 31 '21 at 21:08
  • the variable types are int for `inodes`, `hnodes` and `onodes`. `lr` is a float and `wih` and `who` are float arrays – AnaCoder Apr 01 '21 at 07:33

1 Answers1

1

Cannot add comments due to reputation, but your question seems to be answered here: How to print the full NumPy array, without truncation?

Bottom line:

numpy.set_printoptions(threshold=sys.maxsize)