home *** CD-ROM | disk | FTP | other *** search
/ Robotics & Artificial Int…3 (Professional Edition) / Robotics & Artificial Intelligence Tools 2003 (Professional Edition).iso / neural network tool and application / nsinstall.exe / data1.cab / CustomSolutionWizard_Files / Demo / GetResponse.bas < prev    next >
Encoding:
BASIC Source File  |  2002-03-08  |  945 b   |  29 lines

  1. Sub GetResponse()
  2.     
  3.     'Create a recall network object
  4.     Dim nn As New NSRecallNetwork
  5.  
  6.     'Set the path to the generated neural network DLL
  7.     nn.dllPathName = g_CSWPath + "\Demo\DemoMLP.dll"
  8.  
  9.     'Load the network weights that were saved after training in NeuroSolutions
  10.     nn.loadWeights g_CSWPath + "\Demo\DemoMLP.nsw"
  11.  
  12.     'Get the input data entered in to the "Input Data" text boxes
  13.     Dim InputData(0 To 1, 0 To 0)  As Variant
  14.     InputData(0, 0) = CSng(InputDataTextBox1.Text)
  15.     InputData(1, 0) = CSng(InputDataTextBox2.Text)
  16.     
  17.     'Send the input data to the neural network DLL
  18.     nn.InputData = InputData
  19.     
  20.     'Get the network response (output) for the specified input data
  21.     Dim OutputData As Variant
  22.     OutputData = nn.GetResponse
  23.    
  24.     'Display the network output in "Output Data" text box
  25.     OutputDataTextBox.Text = OutputData(0, 0)
  26.     Me.OutputDataTextBox.Refresh
  27.  
  28. End Sub
  29.