#  -*- coding: utf-8 -*-
"""
How to test a series of results.
"""
__author__ = "Varun Nayyar <nayyarv@gmail.com>"

import torch
from swarm import core, activations, regimes


def main():
    x = torch.linspace(-6, 6, 101)
    y = torch.sin(x)

    bee = regimes.make_bee(regimes.default_train, x, y, num_epochs=50, activation=activations.xTanH)

    # run experiments for each lr and save.
    for lr in (0.001, 0.002, 0.004, 0.008):

        # def default_train(x, y, hidden=2, width=2, activation=nn.ReLU, num_epochs=200, lr=0.001):
        # to compare against

        res = core.swarm_train(bee, {"lr": lr}, num_bees=4, fields="ypred,loss", seed=10)
    return res


if __name__ == "__main__":
    main()

0ab54be758f69c435dba75c84228e42aba8f215f
<mask token>


def main():
    x = torch.linspace(-6, 6, 101)
    y = torch.sin(x)
    bee = regimes.make_bee(regimes.default_train, x, y, num_epochs=50,
        activation=activations.xTanH)
    for lr in (0.001, 0.002, 0.004, 0.008):
        res = core.swarm_train(bee, {'lr': lr}, num_bees=4, fields=
            'ypred,loss', seed=10)
    return res


<mask token>

<mask token>


def main():
    x = torch.linspace(-6, 6, 101)
    y = torch.sin(x)
    bee = regimes.make_bee(regimes.default_train, x, y, num_epochs=50,
        activation=activations.xTanH)
    for lr in (0.001, 0.002, 0.004, 0.008):
        res = core.swarm_train(bee, {'lr': lr}, num_bees=4, fields=
            'ypred,loss', seed=10)
    return res


if __name__ == '__main__':
    main()

<mask token>
__author__ = 'Varun Nayyar <nayyarv@gmail.com>'
<mask token>


def main():
    x = torch.linspace(-6, 6, 101)
    y = torch.sin(x)
    bee = regimes.make_bee(regimes.default_train, x, y, num_epochs=50,
        activation=activations.xTanH)
    for lr in (0.001, 0.002, 0.004, 0.008):
        res = core.swarm_train(bee, {'lr': lr}, num_bees=4, fields=
            'ypred,loss', seed=10)
    return res


if __name__ == '__main__':
    main()

<mask token>
__author__ = 'Varun Nayyar <nayyarv@gmail.com>'
import torch
from swarm import core, activations, regimes


def main():
    x = torch.linspace(-6, 6, 101)
    y = torch.sin(x)
    bee = regimes.make_bee(regimes.default_train, x, y, num_epochs=50,
        activation=activations.xTanH)
    for lr in (0.001, 0.002, 0.004, 0.008):
        res = core.swarm_train(bee, {'lr': lr}, num_bees=4, fields=
            'ypred,loss', seed=10)
    return res


if __name__ == '__main__':
    main()

#  -*- coding: utf-8 -*-
"""
How to test a series of results.
"""
__author__ = "Varun Nayyar <nayyarv@gmail.com>"

import torch
from swarm import core, activations, regimes


def main():
    x = torch.linspace(-6, 6, 101)
    y = torch.sin(x)

    bee = regimes.make_bee(regimes.default_train, x, y, num_epochs=50, activation=activations.xTanH)

    # run experiments for each lr and save.
    for lr in (0.001, 0.002, 0.004, 0.008):

        # def default_train(x, y, hidden=2, width=2, activation=nn.ReLU, num_epochs=200, lr=0.001):
        # to compare against

        res = core.swarm_train(bee, {"lr": lr}, num_bees=4, fields="ypred,loss", seed=10)
    return res


if __name__ == "__main__":
    main()
