A method for operation of a device for optimizing sleep of a subject, the method comprising: monitoring at least one physiological characteristic of a subject indicative of a sleep state; using at least one hardware processor of a portable device, determining a current sleep state of the subject from the at least one monitored physiological characteristic, wherein the current sleep state comprises at least one of rapid-eye-movement sleep or non-rapid-eye-movement (NREM) sleep; determining a desired sleep state for the subject based on one or more rules, the determined current sleep state, and a record of prior sleep states for the subject, and wherein the one or more rules are configured to determine a desired sleep state that maintains a balance between REM sleep and NREM sleep and avoids sleep inertia; generating, using a stimulus generator, at least one sensory stimulus to guide the subject toward the desired sleep state if the desired sleep state differs from the current sleep state, wherein the stimulus generator comprises an eye mask, and wherein the eye mask fits over the subject's eyes or face and houses one or more light emitting elements that provide visual stimulation and one or more heating elements that provide thermal stimulation; and generating at least one sensory stimulus to cause the subject to remain in the current sleep state if the desired sleep state is the same as the current sleep data using at least the one or more heating elements of the eye mask. monitoring at least one physiological characteristic of a subject indicative of a sleep state; using at least one hardware processor of a portable device, determining a current sleep state of the subject from the at least one monitored physiological characteristic, wherein the current sleep state comprises at least one of rapid-eye-movement sleep or non-rapid-eye-movement (NREM) sleep; determining a desired sleep state for the subject based on one or more rules, the determined current sleep state, and a record of prior sleep states for the subject, and wherein the one or more rules are configured to determine a desired sleep state that maintains a balance between REM sleep and NREM sleep and avoids sleep inertia; generating, using a stimulus generator, at least one sensory stimulus to guide the subject toward the desired sleep state if the desired sleep state differs from the current sleep state, wherein the stimulus generator comprises an eye mask, and wherein the eye mask fits over the subject's eyes or face and houses one or more light emitting elements that provide visual stimulation and one or more heating elements that provide thermal stimulation; and generating at least one sensory stimulus to cause the subject to remain in the current sleep state if the desired sleep state is the same as the current sleep data using at least the one or more heating elements of the eye mask. determining a current sleep state of the subject from the at least one monitored physiological characteristic, wherein the current sleep state comprises at least one of rapid-eye-movement sleep or non-rapid-eye-movement (NREM) sleep; determining a desired sleep state for the subject based on one or more rules, the determined current sleep state, and a record of prior sleep states for the subject, and wherein the one or more rules are configured to determine a desired sleep state that maintains a balance between REM sleep and NREM sleep and avoids sleep inertia; generating, using a stimulus generator, at least one sensory stimulus to guide the subject toward the desired sleep state if the desired sleep state differs from the current sleep state, wherein the stimulus generator comprises an eye mask, and wherein the eye mask fits over the subject's eyes or face and houses one or more light emitting elements that provide visual stimulation and one or more heating elements that provide thermal stimulation; and generating at least one sensory stimulus to cause the subject to remain in the current sleep state if the desired sleep state is the same as the current sleep data using at least the one or more heating elements of the eye mask.