California Scientific  *  BrainMaker Neural Network Software  *   800-284-8112 * 916-372-6800
California Scientific      BrainMaker Neural Network Software
Home Applications What Are Neural Networks Products Ordering Info Tech Support
What are NN's
Designing NN's
MMX Computers
References
Reviews of BrainMaker
Why BM is best

Products
BrainMaker
BrainMaker Professional
Competitor
Genetic Training
Intro to NN Book
Do I need Professional?
NN Books For Sale

Ordering Info
International Shipping
Order Form
Price List
Upgrade Order Form

Tech Support
Running Competitor
Financial Networks
Is my data OK?
Using hidden neurons
Large datasets
BrainMaker's precision
Predicting Horses
Setting Min/Max

Year 2000

Article Reprints
Testing Concrete
Decoding Sequences
Hospital Costs

Downloads
MMX test software
order form
upgrade form
Pro Forma invoice

Applications

Stocks
Currency Predictions
Corporate Bonds
S&P 500 Index
Stock Price Prediction
Stock Prophet
Natural Gas Prices

Business
Direct Mail
Credit Scoring
Real Estate Appraisal
Bad Cops
Finding Gold
Jury Summoning
Highway Maintenance

Medical
Breast Cancer
Hospital Expenses
Functional Recovery
Heart Attack Diagnosis
ER Test ordering
Psychiactric Care
Giant Cell Arteritis

Sports
Thoroughbreds
Thoroughbreds 1
Dog Racing

Science
Solar Flares
Protein Sequencing
Mosquito Identification
Spectroscopy
Weather Forecasting
Predicting El Nino
Air Quality

Manufacturing
Welding Quality
Plastics Testing
IC Quality Control
Paper Quality
Concrete Testing
Beer Quality
Enzyme Synthesis
Steam Quality

Pattern Recog.
Speech Recognition
Article Classification
Working with Chaos
Chemical Drawings
Sequence Prediction

Using Runtime.DLL with Visual Basic

BrainMaker Pro comes with runtime.dll, which you use to run a trained network from your own program. Your program can be in C or Visual Basic.

Visual Basic requires routines in DLLs to use the __stdcall calling convention, while C-callable routines use the __cdecl calling convention.

The runtime dll has two sets of exported routines: one set for use from C and the other for use from Visual Basic. The Visual Basic routines have the same names but prepended with the prefix "std" and using the __stdcall convention.

Following is an example of VB declaration code:


Declare Function InitializeNetwork _
Lib "Runtime.dll" Alias "stdInitializeNetwork" _
(ByVal NetworkFilename As String) As Long

Declare Function ProcessInputVector _
Lib "Runtime.dll" Alias "stdProcessInputVector" _
(ByVal NetHandle As Long, ByRef InVal As Single, ByRef OutVal As Single) _
As Long

Declare Sub TerminateNetwork _
Lib "Runtime.dll" Alias "stdTerminateNetwork" _
(ByVal NetHandle As Long)

Note that you declare the function InitializeNetwork but that this refers to the function stdInitializeNetwork in the dll, which is the one you want. Ditto for the other two.

Now here is sample code to run the network:


Private Sub Command1_Click()
    Dim inputs(1) As Single
    Dim outputs(3) As Single
    Dim prompt As String

    NetHandle = InitializeNetwork("logic.net")

    inputs(0) = 0
    inputs(1) = 1
    result = ProcessInputVector(NetHandle, inputs(0), outputs(0))
    prompt = "Output values are " & outputs(0) & " " _
                & outputs(1) & " " _
                & outputs(2) & " " & outputs(3)
    MsgBox (prompt)

    TerminateNetwork (NetHandle)

End Sub

VBTest.zip - an example of using the BrainMaker Professional Runtime system in VB.

The runtime dll lets you use trained networks with large numbers of inputs and outputs. logic.net has 2 inputs and 4 outputs. The function ProcessInputVectors takes the network handle and two vectors, one for the inputs and one for the outputs; these vectors can be quite long.

In the example code, it looks like only one input is being passed, because you pass "inputs(0)" instead of the whole vector "inputs"; remember, however, that Visual Basic passes arguments by reference (that's what ByRef means), so inputs(0) is the address of the entire inputs vector, and similarly for outputs.

So in your application, you still pass inputs(0) as in the example code, but inputs and outputs must be dimensioned large enough to hold all the inputs and outputs.

Home Applications What Are Neural Networks Products Ordering Info Tech Support
California Scientific      BrainMaker Neural Network Software

California Scientific
Sales@CalSci.com • 800-284-8112 • 916-372-6800