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?

3
  • I think if You typed it out by hand it should be fine Commented Mar 31, 2021 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? Commented Mar 31, 2021 at 21:08
  • the variable types are int for inodes, hnodes and onodes. lr is a float and wih and who are float arrays Commented Apr 1, 2021 at 7:33

1 Answer 1

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)
Sign up to request clarification or add additional context in comments.

3 Comments

Thank you very much! With this addition it works as intended.
I'd be grateful for marking my answer as the accepted one ;)
with pleasure! :)

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.