Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Implemented computation of probability matrix #279

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 16 additions & 0 deletions ocropus-rpred
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,8 @@ parser.add_argument('--alocs',action="store_true",
help="output aligned LSTM locations for characters")
parser.add_argument('--probabilities',action="store_true",
help="output probabilities for each letter")
parser.add_argument("--probmat",action="store_true",
help="output and save probability matrix after LSTM Network")

# error measures
parser.add_argument("-r","--estrate",action="store_true",
Expand Down Expand Up @@ -263,9 +265,23 @@ def process1(arg):
plt.ginput(1,99999999)
else:
plt.ginput(1,args.show)


# output probability matrix -------------------------------
if args.probmat:
out = network.outputs.T[0:]
#print(len(out))

timestamp = len(network.outputs[0:])
#print(timestamp)

Text_out = open(base + ".pm","w")
np.savetxt(Text_out, network.outputs.T, fmt='%f')
Text_out.close()
return None



def safe_process1(arg):
trial,fname = arg
try:
Expand Down