docstr: ...Test HawkesSumExpKern fit with different solvers
  and penalties
docstr_tok: ["...","Test","HawkesSumExpKern","fit","with","different","solvers","and","penalties"]
code: def test_HawkesSumExpKern_fit(self):
      """...Test HawkesSumExpKern fit with different solvers
      and penalties
      """
      sto_seed = 179312
      n_nodes = 2
      events, baseline, adjacency = Test.get_train_data(
          self.decays, n_nodes=n_nodes, n_decays=self.n_decays
      )
      start = 0.01
      initial_adjacency_error = Test.estimation_error(
          start * np.ones((n_nodes, n_nodes)), adjacency
      )
  
      for penalty in penalties:
          for solver in solvers:
              solver_kwargs = {
                  "penalty": penalty,
                  "tol": 1e-10,
                  "solver": solver,
                  "verbose": False,
                  "max_iter": 1000,
              }
  
              if penalty != "none":
                  solver_kwargs["C"] = 50
  
              if solver in ["sgd", "svrg"]:
                  solver_kwargs["random_state"] = sto_seed
  
              # manually set step
              if solver == "sgd":
                  solver_kwargs["step"] = 1e-5
              elif solver == "svrg":
                  continue
  
              if solver == "bfgs":
                  # BFGS only accepts ProxZero and ProxL2sq for now
                  if penalty != "l2":
                      continue
  
              if penalty == "nuclear":
                  # Nuclear penalty only compatible with batch solvers
                  if solver in HawkesSumExpKern._solvers_stochastic:
                      continue
  
              learner = HawkesSumExpKern(self.decays, **solver_kwargs)
              learner.fit(events, start=start)
              adjacency_error = Test.estimation_error(
                  learner.adjacency, adjacency
              )
              self.assertLess(
                  adjacency_error,
                  initial_adjacency_error * 0.8,
                  "solver %s with penalty %s "
                  "reached too high baseline error" % (solver, penalty),
              )
  
imports: import unittest
  import numpy
  from tick.base.inference import InferenceTest
  from tick.hawkes import SimuHawkesSumExpKernels, SimuHawkesMulti
  from tick.hawkes.inference import HawkesSumExpKern
  from tick.prox import ProxNuclear
  from tick.prox import ProxPositive, ProxL1, ProxL2Sq, ProxElasticNet
  from tick.solver import AGD, GD, BFGS, SGD, SVRG
label_desc: Use image node_id 6 for calling the Test obj's underlying member method code with example usage: obj.test_HawkesSumExpKern_fit() without return types