• Advertisement
Sign in to follow this  
  • entries
    570
  • comments
    2427
  • views
    216613

Entry #2.71821182145904523

Sign in to follow this  

122 views

  • Random observation of the day!
    No one really reads this, do they?

Anyways, I'm still working hard on my current project: CODENAME SKYNET!!!

I will now pull a Valve

Const e = 2.71828182845905

Public Function limiterFunc(weightedSum As Double, limiterFunction As Long) As Double
'this is the basic function that contains all the limiter
'functions. Put it in here to keep everything clutter-free.

Dim tmp As Double

Select Case limiterFunction
Case 0
'default function - step function

'if it's less than 0, return 0
If weightedSum <= 0 Then
limiter = 0
Exit Function

'if its greater than 0, return 1
ElseIf weightedSum > 0 Then
limiter = 1
Exit Function
End If

Case 1
'Sigmoid Function
tmp = 1 / (1 + e ^ (-1 * weightedSum))
'Debug.Print tmp
limiterFunc = tmp
'Debug.Print limiterFunc

Exit Function

Case Else
'something weird going on
Debug.Print "Invalid limiter function used..."
End Select
End Function



Have a nice day!
Sign in to follow this  


5 Comments


Recommended Comments

Well, I read it. Ummm, red... Grrr.. There's no past tense of read that's different spelling then read. Hrmmm, I give up.

Share this comment


Link to comment
"Pull a Valve" = inadventently disclose source
"limiter..." = read next line - I didn't bother to put VB in the source tag; it's a comment

But wow... someone does read these.

Share this comment


Link to comment

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

  • Advertisement