473,386 Members | 1,835 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,386 software developers and data experts.

Weird output when using more samples (help)

I'm making a feature-file to train a Neural Network, but now that I've
added a new feature, the output becomes corrupted. The output is as
follows:
3000 25
1_002858 5 0 0 0 0 2 2 0 0 0 0 2 2 0 0 0 0 0 4 0 0 0 0 0 4
5_002671 2 1 1 0 0 0 0 0 0 1 2 0 0 0 2 1 0 0 0 0 3 0 0 0 1
7_001096 0 0 0 0 3 0 0 0 0 2 0 0 0 0 2 0 0 0 0 2 2 2 2 2 3
7_003394 0 0 1 0 0 0 0 1 0 0 1 1 2 2 0 0 0 0 1 0 2 1 1 1 3
2_003185 2 4 2 2 2 2 0 2 0 0 0 0 1 0 0 0 0 1 0 0 0 1 0 0 0
0_000097 3 2 2 0 0 1 0 0 2 0 0 0 0 0 2 0 0 0 0 1 0 0 1 2 2
3_003450 0 0 1 1 1 0 0 0 0 1 0 2 1 1 2 0 0 1 1 0 1 1 1 1 1
2_002966 3 2 2 2 0 2 0 0 0 2 0 2 0 0 0 0 1 0 0 0 2 2 1 0 0
0_001064 1 1 1 1 0 1 0 0 0 1 1 1 0 0 1 1 1 0 0 1 1 2 1 1 0
7_002859 0 0 1 0 0 0 0 0 0 0 0 1 1 2 1 0 0 0 0 1 1 1 1 1 1
4_003501 0 0 1 0 0 0 1 3 0 0 2 0 1 0 0 2 0 0 1 0 0 0 0 0 1
1_002759 0 0 0 4 3 0 0 3 0 0 0 3 1 0 0 2 1 0 0 0 4 0 0 0 0
8_001458 2 0 0 0 1 0 1 0 0 1 0 0 1 0 1 0 0 0 1 1 0 0 0 0 1
1_000255 1 1 1 0 0 0 0 1 3 0 0 0 0 0 4 0 0 0 0 4 0 0 0 0 4
4_001116 0 0 2 0 0 0 0 1 0 0 2 1 1 3 0 1 0 0 1 2 1 1 0 0 1
3_003398 1 1 1 1 0 0 0 0 0 1 0 1 1 1 0 0 0 1 1 0 1 1 1 1 2
0_001471 0 2 0 0 0 0 1 1 0 0 1 0 1 0 1 1 0 0 2 1 0 0 0 0 1
@+~Y~Y~Y~Y~Y~Z?ð 1 2 2 2 2 2 0 0 0 0 0 2 0 0 0 0 0 1 0 0 2 2 0 0 0
1_001419 5 2 0 0 0 0 3 0 0 0 0 0 2 1 0 0 0 0 2 1 0 0 0 0 4
3_002413 1 1 1 1 2 1 0 0 0 1 0 1 1 0 0 0 1 1 0 0 1 1 1 2 0
5_000198 0 0 1 0 0 0 0 1 0 0 0 1 0 0 0 1 0 0 0 1 0 3 0 0 0

The first number in the file is the number of samples and the second is
the number of numbers that the feature has. The first character string
on each successive row is a label that is used to identify a certain
sample. The other numbers are the feature.
Notice how the label on the fourth row from the bottom is corrupted?
That's the problem. Strangely enough, my feature-program does
absolutely nothing with the labels. Other features work fine and it
also works fine when I use approx. 900 (somewhere between 900 and 950)
or less samples.
The feature-function is called in one for-loop and the printing is done
in another one.
Something like this:
samples = read_all_hwr(argv[1],&nsamples, 0);
grids = (int**) malloc (sizeof(int*)*nsamples);
for (i = 0; i < nsamples; i++) {
grids[i] = hwr2grid(samples[i], width, height);
}

for (i = 0; i < nsamples; i++) {
printf("\n%s", samples[i]->label);
}

If I would put the printf-statement in the the first for-loop before or
after the call to hwr2grid, the error doesn't occur, but this isn't
really a nice option for the real program and besides, I want to know
what's wrong. If I call another feature in the first for-loop before or
after hwr2grid, the problem also disappears.
samples = read_all_hwr(argv[1],&nsamples, 0);
grids = (int**) malloc (sizeof(int*)*nsamples);
chaincodes = (int**) malloc (sizeof(int*)*nsamples);
for (i = 0; i < nsamples; i++) {
chaincodes[i] = hwr2chain(samples[i], nquant, nsegments);
grids[i] = hwr2grid3(samples[i], width, height);
}

for (i = 0; i < nsamples; i++) {
printf("\n%s", samples[i]->label);
}
I will do this eventually, but I would really like to know what is
wrong, because it might have other side-effects that I'm not aware of.

It really doesn't make any sense to me, because:
1) labels are not altered anywhere.
2) if they were altered in hwr2grid, why aren't they all?
3) if some are altered, then how does hwr2chaincode disable this
change, if it is called BEFORE hwr2grid?

At first I thought that maybe it had something to do with using too
much memory, but then it wouldn't really make sense that using even
more memory (adding the other feature) would cancel the problem.

I really hope you guys could help me with this. Thanks!

Jun 27 '06 #1
0 1262

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

1
by: amit | last post by:
I am trying to compile the sample program genwin.sqc, using nsqlprep which is used to precompile embedded sql in C. I am getting weird errors and that is because windows.h is included in the...
0
by: Naren | last post by:
I have an XML like the one below. I am using SAX parsing and I need to get the information between the tags of the Email element. First i try to access the content and print it out and it gives...
10
by: Bonj | last post by:
Hello. I hope somebody can help me on this, because I'm running out of options to turn to. I have almost solved my regular expression function. Basically it works OK if unicode is defined. It...
4
by: Kevin Mansel via .NET 247 | last post by:
Ok, basically this is my problem. I'm building a console app tocall a dos program. So i'm using the Shell command to call theprogram, now depending on what happens, I want to read theoutput that...
1
by: evan.lavidor | last post by:
Hi all, Forgive me if this topic has been discussed before. I've been doing some searching and have yet to come across the answer I'm looking for. I'm new to PHP, and I'm trying to call a...
0
by: IamtheEvster | last post by:
Hi All, I am currently using PHP 5 and MySQL 5, both on Fedora Core 5. I am unable to call a MySQL stored procedure that returns output parameters using mysql, mysqli, or PDO. I'm having a...
0
by: spacelabstudio | last post by:
Hi, I'm observing some weird behavior and have written the following test program to demonstrate. This works under cygwin/WinXP but not Gentoo(kernel 2.6): huh.py...
5
by: Pupeno | last post by:
Hello, I am experiencing a weird behavior that is driving me crazy. I have module called Sensors containing, among other things: class Manager: def getStatus(self): print "getStatus(self=%s)"...
10
by: alsmeirelles | last post by:
Hi all, I Have run this test: Private Sub test() Dim d As Double Dim f As Single Dim output As String d = 8888888888888.8887
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.